-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b10df1d
commit 5748748
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
wild_visual_navigation_ros/src/wild_visual_navigation_ros/reload_rosparams.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (c) 2022-2024, ETH Zurich, Matias Mattamala, Jonas Frey. | ||
# All rights reserved. Licensed under the MIT license. | ||
# See LICENSE file in the project root for details. | ||
# | ||
# | ||
# Copyright (c) 2022-2024, ETH Zurich, Matias Mattamala, Jonas Frey. | ||
# All rights reserved. Licensed under the MIT license. | ||
# See LICENSE file in the project root for details. | ||
# | ||
import rospkg | ||
import rospy | ||
import os | ||
|
||
def reload_rosparams(enabled, node_name, camera_cfg): | ||
if enabled: | ||
try: | ||
rospy.delete_param(node_name) | ||
except: | ||
pass | ||
|
||
rospack = rospkg.RosPack() | ||
wvn_path = rospack.get_path("wild_visual_navigation_ros") | ||
os.system(f"rosparam load {wvn_path}/config/wild_visual_navigation/default.yaml {node_name}") | ||
wvn_anymal = rospack.get_path("wild_visual_navigation_anymal") | ||
os.system(f"rosparam load {wvn_anymal}/config/wild_visual_navigation/inputs/{camera_cfg}.yaml {node_name}") |