ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Order of published joints from joint_state_controller

asked 2018-02-08 02:18:03 -0600

JPSG gravatar image

Hello all. I am wondering if it is possible to control the order in which the joint_state_controller publishes the robot joints and their respective values?

I am simulating a UR5 manipulator in Gazebo, and if we look at a sample message taken from the published /joint_states topic, they seem to be ordered in alphabetical (?) order (FYI the elbow_joint and shoulder_pan_joints should be switched):

header: 
  seq: 685
  stamp: 
    secs: 13
    nsecs: 722000000
  frame_id: ''
name: [elbow_joint, shoulder_lift_joint, shoulder_pan_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint]
position: [-9.935968448004928e-07, -1.5675146858950169, -0.0005566812821147238, -1.567509637814898, -1.5170622604365747e-05, -1.739371527698097e-06]
velocity: [3.6741224523988668e-06, -5.112008493828534e-05, 0.001605313567856731, 3.934066966728182e-05, 5.4372582579940575e-05, 6.217080293624165e-06]
effort: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

Is there a simple solution to publishing these messages in the order in which they appear in the kinematic chain (i.e base_link --> .. --> tip_link).

I am currently manually sorting this data to the correct order when I read it into a node, but this is fairly inelegant (especially if i were to switch to a different robot which is for some reason publishing in the correct order).

I have used the controller_joint_names parameter in the past to do this in the industrial_robot_client, is there something similar method I can use for the joint_state_controller ? ( http://wiki.ros.org/industrial_robot_... )

Thanks!

/////////////////////Details//////////////////////////////////////

First I load the relevant parameter .yaml files

 <!-- Load controller parameters -->
<rosparam file="$(find environment_config)/controller/controller_setup.yaml" command="load"/>

and then spawn my arm and joint_state_controllers from there

<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen"
args="arm_controller joint_state_controller"/>

contents of controller_setup.yaml

joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50
# -------------------------------------------------------
arm_controller:
  type: position_controllers/JointTrajectoryController
  joints:
     - shoulder_pan_joint
     - shoulder_lift_joint
     - elbow_joint
     - wrist_1_joint
     - wrist_2_joint
     - wrist_3_joint
  constraints:
      goal_time: 0.6
      stopped_velocity_tolerance: 0.05
      shoulder_pan_joint: {trajectory: 0.1, goal: 0.1}
      shoulder_lift_joint: {trajectory: 0.1, goal: 0.1}
      elbow_joint: {trajectory: 0.1, goal: 0.1}
      wrist_1_joint: {trajectory: 0.1, goal: 0.1}
      wrist_2_joint: {trajectory: 0.1, goal: 0.1}
      wrist_3_joint: {trajectory: 0.1, goal: 0.1}
  stop_trajectory_duration: 0.5
  state_publish_rate:  25
  action_monitor_rate: 10
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-02-08 02:22:19 -0600

gvdhoorn gravatar image

I am wondering if it is possible to control the order in which the joint_state_controller publishes the robot joints and their respective values?

No. This is a ros_control feature/limitation.

See ThomasTimm/ur_modern_driver#113 for some discussion (there are probably tickets over at the ros_control tracker as well, but this one I readily remembered).

edit flag offensive delete link more

Comments

Ok thanks for the tip :)

JPSG gravatar image JPSG  ( 2018-02-08 02:30:39 -0600 )edit

Question Tools

Stats

Asked: 2018-02-08 02:18:03 -0600

Seen: 860 times

Last updated: Feb 08 '18