Hello everyone,
I am working on the Quiz trying to spawn the Gurdy robot. I have followed the class and done the my_mira_description package successfully, but I am not being able to understand what am I missing in order to spawn Gurdy, when it appears in the gazebo simulation it falls apart. I have even tried with the original gurdy.urdf file, in gurdy_description package, but the same happens.
Here you can find my code:
As asked in the quiz, the main launch file is spawn_gurdy.launch
Are you publishing the tf? Are the controllers running?
I think I am, somewhere within the spawn_gurdy.launch, I call gurdy_control.launch which is the following launch file:
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find my_gurdy_description)/config/gurdy_controller.yaml"
command="load"/>
<node name="controller_spawner"
pkg="controller_manager"
type="spawner"
respawn="false"
output="screen"
ns="/gurdy"
args="head_upperlegM1_joint_position_controller
head_upperlegM2_joint_position_controller
head_upperlegM3_joint_position_controller
upperlegM1_lowerlegM1_joint_position_controller
upperlegM2_lowerlegM2_joint_position_controller
upperlegM3_lowerlegM3_joint_position_controller
joint_state_controller --shutdown-timeout 3"/>
<node name="robot_state_publisher"
pkg="robot_state_publisher"
type="robot_state_publisher"
respawn="false"
output="screen">
<remap from="/joint_states" to="/gurdy/joint_states" />
</node>
</launch>
When I do rostopic list I see only the following related to gurdy:
/gurdy/imu/data
/gurdy/joint_states
So I guess the controllers might be missing? Yet I am not really understanding why, I have double checked the gurdy_controller.yaml file
can you check whether tf and joint_states are properly published? Do you get values there?
Also you might wanna try pausing the simulation first, then spawning it.
No, I do not get any values either in tf or joint_states.
I did some changes to reorganize my repository, now the code is here:
Hi @soffx27,
I dove deep into it and eventually figured it out. The issue lies with the namespace. I got it to work by removing it, how to properly add it, you gonna have to figure out, but this is at least a working startingpoint.
new gurdy_control.launch
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find my_gurdy_description)/config/gurdy_controller.yaml" command="load" />
<!-- load the controllers -->
<node name="controller_spawner"
pkg="controller_manager"
type="spawner"
respawn="false"
output="screen"
args="head_upperlegM1_joint_position_controller
head_upperlegM2_joint_position_controller
head_upperlegM3_joint_position_controller
upperlegM1_lowerlegM1_joint_position_controller
upperlegM2_lowerlegM2_joint_position_controller
upperlegM3_lowerlegM3_joint_position_controller
joint_state_controller --shutdown-timeout 3"/>
<!-- convert joint states to TF transforms for rviz, etc -->
<node name="robot_state_publisher"
pkg="robot_state_publisher"
type="robot_state_publisher"
respawn="false"
output="screen">
</node>
</launch>
new gurdy_controller.yaml
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
# Position Controllers ---------------------------------------
head_upperlegM1_joint_position_controller:
type: effort_controllers/JointPositionController
joint: head_upperlegM1_joint
pid: {p: 3.0, i: 1.0, d: 0.0}
head_upperlegM2_joint_position_controller:
type: effort_controllers/JointPositionController
joint: head_upperlegM2_joint
pid: {p: 3.0, i: 1.0, d: 0.0}
head_upperlegM3_joint_position_controller:
type: effort_controllers/JointPositionController
joint: head_upperlegM3_joint
pid: {p: 3.0, i: 1.0, d: 0.0}
upperlegM1_lowerlegM1_joint_position_controller:
type: effort_controllers/JointPositionController
joint: upperlegM1_lowerlegM1_joint
pid: {p: 3.0, i: 1.0, d: 0.0}
upperlegM2_lowerlegM2_joint_position_controller:
type: effort_controllers/JointPositionController
joint: upperlegM2_lowerlegM2_joint
pid: {p: 3.0, i: 1.0, d: 0.0}
upperlegM3_lowerlegM3_joint_position_controller:
type: effort_controllers/JointPositionController
joint: upperlegM3_lowerlegM3_joint
pid: {p: 3.0, i: 1.0, d: 0.0}
Simon, hi,
Thank you very much! It works that way…
Now I’ll try to figure out why the ns is wrong.
Best regards
1 Like