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

Revision history [back]

click to hide/show revision 1
initial version

Right, so I have partially been able to fix the problem. I noticed that the joint_trajectory_action was launched by the industrial_robot_simulator in the pacbot_moveit_planning_execution.launch, so in that file I changed this:

<!-- run the robot simulator and action interface nodes -->
<group if="$(arg sim)" >
  <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>

to this:

<!-- run the robot simulator and action interface nodes -->
<group if="$(arg sim)" ns="arm1" >
  <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>
<group if="$(arg sim)" ns="tensioner" >
  <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>

The rest of that file is still the same as the template given in the tutorial. As for the real robot's drivers, they do not exist yet, nor do we even have access to such a robotic arm. The aim of our project is mainly to provide a simulation as a proof of concept of the system.

As for controllers.yaml file, I've added the tensioner's controller and gave them names. Note that I changed the MoveIt configuration to have one planning group called Tensioner that contains both track2_joint and track3_joint, instead of splitting those into two groups Track2 and Track3. Here's my new controllers.yaml file.

controller_list:
- name: arm1
  action_ns: joint_trajectory_action
  type: FollowJointTrajectory
  joints: [cart1_joint, main1_joint, elbow1_joint, forearm1_joint, wrist1_joint, gripper1_joint]
- name: tensioner
  action_ns: joint_trajectory_action
  type: FollowJointTrajectory
  joints: [track2_joint, track3_joint]

So now the joint_trajectory_action of each is in the right namespace. But I noticed that the messages published to both /arm1/joint_states and /tensioner/joint_states contained the standard joint names (joint_1, joint_2 ..., joint_6) instead of the joints I wanted. After some looking around, I found out how to change my joint_names.yaml accordingly:

arm1:
  controller_joint_names: [cart1_joint, main1_joint, elbow1_joint, forearm1_joint, wrist1_joint, gripper1_joint]
tensioner:
  controller_joint_names: [track2_joint, track3_joint]

The joint_states topics of both now contain the right joint names. However, when I go into my code and try to execute the Python code from my question, then moveGroup.get_current_joint_values() prints the following error:

[ERROR] [1515592922.743672836]: Failed to fetch current robot state

Is there something I forgot to change? I also noticed that the /joint_states topic still exists, although nothing is publishing to it. However, robot_state_publisher and move_group are subscribed to it. To me that indicates that I forgot to change something, right?

Right, so With the help of @gvdhoorn I have partially been able to fix the problem. Here's how..

First of all, I noticed that the joint_trajectory_action was launched by the industrial_robot_simulator in the pacbot_moveit_planning_execution.launch, so in that file order to get those topics in the right namespace, I changed this:this in that file:

<!-- run the robot simulator and action interface nodes -->
<group if="$(arg sim)" >
  <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>

to this:

<!-- run the robot simulator and action interface nodes -->
<group if="$(arg sim)" ns="arm1" >
  <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>
<group if="$(arg sim)" ns="tensioner" ns="track2" >
  <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>
<group if="$(arg sim)" ns="track3" >
  <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>

and added the following to aggregate the joint_states topics of each controller into the general /joint_states topic.

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
  <param name="/use_gui" value="false" />
  <rosparam param="/source_list">[/arm1/joint_states, /track2/joint_states, /track3/joint_states]</rosparam>
</node>

The rest of that file is still the same as the template given in the tutorial. As for the real robot's drivers, they do not exist yet, nor do we even have access to such a robotic arm. The aim of our project is mainly to provide a simulation as a proof of concept of the system.

As for controllers.yaml file, I've added the tensioner's controller controllers of the two tracks and gave them names. Note that I changed the MoveIt configuration to have one planning group called Tensioner that contains both track2_joint and track3_joint, instead of splitting those into two groups Track2 and Track3. Here's my new controllers.yaml file.names:

controller_list:
- name: arm1
  action_ns: joint_trajectory_action
  type: FollowJointTrajectory
  joints: [cart1_joint, main1_joint, elbow1_joint, forearm1_joint, wrist1_joint, gripper1_joint]
- name: tensioner
track2
  action_ns: joint_trajectory_action
  type: FollowJointTrajectory
  joints: [track2_joint, track3_joint]
[track2_joint]
- name: track3
  action_ns: joint_trajectory_action
  type: FollowJointTrajectory
  joints: [track3_joint]

So now the joint_trajectory_action of each is in the right namespace. But I noticed that the messages published to both /arm1/joint_states and /tensioner/joint_states, /track2/joint_states and /track3/joint_states contained the standard joint names (joint_1, joint_2 ..., joint_6) instead of the joints I wanted. my system has. After some looking around, I found out how to change my joint_names.yaml accordingly:

arm1:
  controller_joint_names: [cart1_joint, main1_joint, elbow1_joint, forearm1_joint, wrist1_joint, gripper1_joint]
tensioner:
track2:
  controller_joint_names: [track2_joint, track3_joint]
[track2_joint]
track3:
  controller_joint_names: [track3_joint]

The joint_states topics of both these three controllers now contain the right joint names. However, when I go into names and the joint_state_publisher is now correctly able to aggregate all of these to the general /joint_states topic. All of the above combined solved my code and try to execute the Python code from my question, then moveGroup.get_current_joint_values() prints the following error:

[ERROR] [1515592922.743672836]: Failed to fetch current robot state

Is there something I forgot to change? I also noticed that the /joint_states topic still exists, although nothing is publishing to it. However, robot_state_publisher and move_group are subscribed to it. To me that indicates that I forgot to change something, right?

problem. Now I'll just need to do this for the gripper as well... :)