Fixed typo and moved pid gains to namespace
This commit is contained in:
parent
d601655fca
commit
06cd9fafb0
1 changed files with 4 additions and 5 deletions
|
@ -139,7 +139,7 @@ def export_gazebo_model(assembly_file, model_dir, configs={}):
|
||||||
plugin = ET.SubElement(gazebo, 'plugin')
|
plugin = ET.SubElement(gazebo, 'plugin')
|
||||||
plugin.set('filename', 'libgazebo_ros_control.so')
|
plugin.set('filename', 'libgazebo_ros_control.so')
|
||||||
plugin.set('name', 'gazebo_ros_control')
|
plugin.set('name', 'gazebo_ros_control')
|
||||||
namespace = ET.SubElement(plugin, 'robotNameSpace')
|
namespace = ET.SubElement(plugin, 'robotNamespace')
|
||||||
namespace.text = '/'+robot_name
|
namespace.text = '/'+robot_name
|
||||||
simtype = ET.SubElement(plugin, 'robotSimType')
|
simtype = ET.SubElement(plugin, 'robotSimType')
|
||||||
simtype.text = 'gazebo_ros_control/DefaultRobotHWSim'
|
simtype.text = 'gazebo_ros_control/DefaultRobotHWSim'
|
||||||
|
@ -188,11 +188,10 @@ def export_gazebo_model(assembly_file, model_dir, configs={}):
|
||||||
'publish_rate': 50,
|
'publish_rate': 50,
|
||||||
'joints': joint_names
|
'joints': joint_names
|
||||||
}
|
}
|
||||||
pid_gains = {}
|
control_configs[robot_name]['gazebo_ros_control/pid_gains'] = {}
|
||||||
control_configs['gazebo_ros_control/pid_gains'] = {}
|
|
||||||
for joint in joint_names:
|
for joint in joint_names:
|
||||||
control_configs['gazebo_ros_control/pid_gains'][joint] = pid.copy()
|
control_configs[robot_name]['gazebo_ros_control/pid_gains'][joint] = pid.copy()
|
||||||
os.makedirs(os.path.join(model_dir, 'config'), exist_ok=True)
|
os.makedirs(os.path.join(model_dir, 'config'), exist_ok=True)
|
||||||
with open(os.path.join(model_dir, 'config', robot_name+'_controll.yaml'), 'w') as control_configs_file:
|
with open(os.path.join(model_dir, 'config', robot_name+'_controll.yaml'), 'w') as control_configs_file:
|
||||||
yaml.dump(control_configs, control_configs_file)
|
yaml.dump_all([control_configs], control_configs_file, sort_keys=False)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue