hbp_nrp_commons.sim_config.ConfigEditor module¶
This module provides support methods to manipulate exc and bibi files.
-
class
ConfigEditor
(sim_config)[source]¶ Bases:
object
‘Friend’ class for SimConfig to manipulate (in-memory and storage) exc and bibi
-
add_bodymodel
(robot_id, model_path, robot_model)[source]¶ Adds a <bodyModel> tag in the bibi
- Parameters
robot_id – attribute robotId in the tag
model_path – value() fo the tag
robot_model_name – the name of the model is based the robot
- Returns
-
add_robotpose
(robot_id, pose=None)[source]¶ Adds a <robotPose> tag in the exc
- Parameters
robot_id – robotId attribute for the tag
pose – A cle_ros_msgs.msgs.Pose object (defines an object’s Euler pos and orientation)
- Returns
-
delete_bodymodel
(robot_id)[source]¶ Deletes a <bodyModel> tag from the bibi
- Parameters
robot_id – attribute robotId in the tag
- Returns
-
delete_robotpose
(robot_id)[source]¶ Deletes <robotPose> tag in the exc where robotId is robot_id
- Parameters
robot_id – robotId attribute for the tag
- Returns
-
update_robotpose
(robot_id, pose)[source]¶ Edit <robotPose> tag in the exc where robotId is robot_id
- Parameters
robot_id – robotId attribute for the tag
pose – A cle_ros_msgs.msgs.Pose object (defines an object’s Euler pos and orientation)
- Returns
Tuple (True, SDF relative path) or (False, error message) to update config files
-