The short answer to your question is
rosparam get robot_config/<side>_config/joint_names
where is either left or right, depending on your arm of interest.
The longer answer is that Baxter's interface allows for you to specify the joints in the order that you desire when commanding a JointCommand:
Simply populate the
joint_names array in the same order that you populate your
command array, eg.
from baxter_core_msgs.msg import JointCommand
cmd = JointCommand()
cmd.mode = JointCommand.POSITION_MODE
cmd.names = ["right_s0", "right_s1", "right_e0", "right_e1", "right_w0", "right_w1", "right_w2"]
cmd.command = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
cmd.mode = baxter_core_msgs::JointCommand.POSITION_MODE
for(size_t i = 0; i < cmd.names.size(); i++)
cmd.command[i] = 0.0;
Admittedly in both of those examples, I preserved the joint ordering from proximal to distal, but that is not necessary. The commands are reordered based on joint names once they are received by the MotorController.
Originally posted by imcmahon with karma: 790 on 2016-09-06
This answer was ACCEPTED on the original site
Post score: 1