Ask Your Question
1

urdf_spawner -J option not working as intended

asked 2014-04-16 00:25:33 -0600

ChickenSoup gravatar image

updated 2014-04-16 00:28:53 -0600

Hi all,

I want to set the initial joint positions of a robot in gazebo simulator starting with paused physics. I used the following in the launch file.

  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
        args="-urdf -model ps -param robot_description -J joint1 1.5 -J joint2 0.75 -J joint3 -0.5"/>

also I tried,

<node pkg="rosservice" type="rosservice" name="resetter"
                args="call --wait /gazebo/set_model_configuration '{model_name: ps, urdf_param_name: robot_description, joint_names: [joint1, joint2, joint3], joint_positions: [1.5, 0.75, -0.5]}'" />

without the -J option in urdf_spawner. Neither seems to work. Currently I have not implemented any controllers for the joints. Therefore, disabling controllers as in this need not be considered for the time being. I could see the following messages but still the joint angles have not changed.

[INFO] [WallTime: 1397641007.444278] [0.000000] Waiting for service /gazebo/set_model_configuration
[INFO] [WallTime: 1397641007.445439] [0.000000] Calling service /gazebo/set_model_configuration
[INFO] [WallTime: 1397641007.446698] [0.000000] Set model configuration status: SetModelConfiguration: success

The only way I could get it to work is by calling:

rosservice call /gazebo/set_model_configuration '{model_name: ps, urdf_param_name: robot_description, joint_names: [joint1, joint2, joint3], joint_positions: [1.5, 0.75, -0.5]}'

separately before I unpause physics.

I use ROS-Hydro with Gazebo 1.9

Any help would be really appreciated. Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-11-17 04:00:01 -0600

130s gravatar image

Looking at the code of urdf_spawner.spawn_model today, the way you pass arguments seems fine. I suggest you open an issue at the issue tracker.

Also recently you can pass them via parameter. See https://github.com/ros-simulation/gaz...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-04-16 00:25:33 -0600

Seen: 764 times

Last updated: Nov 17 '15