Using MoveIt with ros_control - why are /joint_states all zero?
Hi,
I'm having real difficulty configuring MoveIt with ros_control for my robot. I have used the SetupAssistant to create a config package, then have made some of my own launch and config files following tutorials.
I have managed to get to the point where everything seems to launch successfully with no errors, but when I echo /joint_states or publish the joint positions that I am getting in my RobotHW class, I am getting a constant array of zeros, even though I am executing a goal in RViz. Interestingly, if I echo /arm_joint_controller/follow_joint_trajectory/goal, then this does seem to give me a series of joint positions when a goal is executed.
I have included my main launch and configuration files below. If there is any other info which would help please let me know and I will include it. If anyone could take a look and tell me where I'm going wrong I would be eternally grateful - after many hours it's starting to drive me mad! :p
Thanks.
spawn_bolt_arm.launch:
<launch>
<!-- Load the URDF into the ROS Parameter Server-->
<param name="robot_description"
command="$(find xacro)/xacro.py '$(find bolt_description)/urdf/bolt_arm.xacro'"/>
<!-- Launch controller_manager and RobotHW -->
<rosparam command="load" file="$(find bolt_robot)/config/bolt_robot.yaml"/>
<node pkg="bolt_robot" type="bolt_robot_node" name="bolt_robot_node"/>
<!-- Launch arm_joint_publisher -->
<include file="$(find bolt_control)/launch/arm_joint_publisher.launch"/>
<!-- Launch arm_joint_controller and gripper_joint_controller -->
<include file="$(find bolt_control)/launch/arm_trajectory_controller.launch"/>
<!-- Launch MoveIt -->
<include file="$(find bolt_arm_config)/launch/moveit_planning_execution.launch"/>
</launch>
arm_joint_publisher.launch:
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find bolt_control)/config/arm_joint_states.yaml"
command="load"/>
<!-- Convert joint states to TF transforms for rviz, etc -->
<node name="robot_state_publisher" pkg="robot_state_publisher"
type="robot_state_publisher" respawn="false" output="screen"/>
<node name="joint_controller_spawner" pkg="controller_manager" type="spawner"
args="arm_joint_publisher" output="screen" respawn="false"/>
</launch>
arm_trajectory_controller.launch:
<launch>
<rosparam file="$(find bolt_control)/config/arm_trajectory_control.yaml"
command="load"/>
<node name="bolt_arm_controller_spawner" pkg="controller_manager"
type="spawner" output="screen" args="arm_joint_controller gripper_joint_controller"/>
</launch>
moveit_planning_execution.launch:
<launch>
<arg name="debug" default="false"/>
<include file="$(find bolt_arm_config)/launch/move_group.launch">
<arg name="publish_monitored_planning_scene" value="true"/>
</include>
<!-- Run Rviz and load the default config to see the state of the move_group node -->
<include file="$(find bolt_arm_config)/launch/moveit_rviz.launch">
<arg name="config" value="true"/>
<arg name="debug" value="$(arg debug)"/>
</include>
</launch>
bolt_arm_moveit_controller_manager.launch.xml:
<launch>
<!-- Set the param that trajectory_execution_manager needs to find
the controller plugin -->
<arg name="moveit_controller_manager"
default="moveit_simple_controller_manager/MoveItSimpleControllerManager"/>
<param name="moveit_controller_manager" value="$(arg moveit_controller_manager)"/>
<!-- Load controller_list -->
<arg name="use_controller_manager" default="true"/>
<param name="use_controller_manager" value="$(arg use_controller_manager)"/>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find bolt_arm_config)/config/controllers.yaml"/>
</launch>
arm_joint_states.yaml:
arm_joint_publisher:
type: "joint_state_controller/JointStateController"
publish_rate: 50
arm_trajectory_control.yaml:
arm_joint_controller:
type: "position_controllers/JointTrajectoryController"
joints:
- base_joint
- shoulder_joint
- elbow_joint
- wrist_joint
- wrist_rotate_joint
gripper_joint_controller:
type: "position_controllers/JointTrajectoryController"
joints:
- left_gripper_joint
- right_gripper_joint
controllers.yaml:
controller_manager_ns: controller_manager
controller_list:
- name: arm_joint_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true
joints:
- base_joint
- shoulder_joint
- elbow_joint
- wrist_joint
- wrist_rotate_joint
- name: gripper_joint_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true
joints:
- left_gripper_joint
- right_gripper_joint