Publishing on /gripper_manipulator_controller/command topic after unpausing gazebo giving unexpected output.

asked 2020-05-26 14:48:52 -0500

updated 2020-05-27 12:00:24 -0500

Hey, I hope you are doing well. I am testing a ur5 robotic arm, but I came across a known bug. I want to define starting joint angles of the ur5 without which my robot is colliding with the table in front of it and for that I used below commands(gazebo started in paused state in both the versions):


<node ="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model ur5 -z 0.594 -J shoulder_linameft_joint -1.8 -J elbow_joint 1.0" output="screen" />


<node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model"  args="-param robot_description -urdf -unpause -z 0.594 -model ur5 -J ur5::shoulder_lift_joint -1.8 -J ur5::elbow_joint -1.0" output="screen" />

None of the above versions worked for me. In the first version, the -J arguments are not applied and the ur5 is still in the "all joints 0.0" configuration. The second version is sometimes working, sometimes not. After going through several websites, I found a working solution.

The solution was to start the gazebo in paused state and start a spawn_gazebo_model node as below

<node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-param robot_description -urdf -z 0.594 -model ur5"/>

and run below command in a new terminal:

run rosservice call /gazebo/set_model_configuration '{ model_name: "ur5", urdf_param_name: "robot_description", joint_names: [ "shoulder_lift_joint", "elbow_joint" ], joint_positions: [ -1.8, 1.0] }' in another terminal.

When I unpause gazebo(without which I am getting following error - Can't accept new commands. Controller is not running.) and try to move gripper joints using below command

rosservice call gazebo/unpause_physics && rostopic pub /gripper_manipulator_controller/command trajectory_msgs/JointTrajectory '{joint_names: ["robotiq_85_left_knuckle_joint"], points: [{positions:[0.8028], time_from_start: [1.0,0.0]}]}' -1

I am getting below output:

image description

The gripper joints are moving as expected but after that it looks like everything is falling apart like below:

image description

I am trying to figure out the reason why this is happening. I guess it might have something to do with some gazebo specific parameters, or I am doing something wrong while pausing-unpausing gazebo simulation.

ROS Distro: Kinetic
OS Version: Ubuntu 16.04
Gazebo version: 9.13.0

I would really appreciate someone's help/advice on this. Thank you in advance!

edit retag flag offensive close merge delete