ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hey,
because I was scratching my head on the same error, here my solution if you use Gazebo and MoveIt:
First you have to load and spawn the controller in your start_robot_in_gazebo.launch when starting gazebo. For example:
<rosparam file="$(find GAZEBO_PKG)/config/gazebo_controllers.yaml" command="load"/>
<node name="arm_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn arm_controller" respawn="false" output="screen"/>
With the gazebo_controllers.yaml something like:
arm_controller:
type: position_controllers/JointTrajectoryController
joints:
- joint_1
- joint_2
- ...
Now first launch gazebo:
$ roslaunch GAZEBO_PKG start_robot_in_gazebo.launch
When using MoveIt with
(two consoles)
$ roslaunch MOVIT_CONFIG_PKG moveit_planning_execution.launch sim:=true
$ roslaunch MOVIT_CONFIG_PKG moveit_rviz.launch config:=true
With the moveit_planning_execution.launch looking like this:
<launch>
<arg name="sim" default="false" />
<arg name="debug" default="false" />
<!-- Remap follow_joint_trajectory -->
<remap if="$(arg sim)" from="/follow_joint_trajectory" to="/arm_controller/follow_joint_trajectory"/>
ddfg
<!-- Launch moveit -->
<include file="$(find MOVIT_CONFIG_PKG)/launch/move_group.launch">
<arg name="debug" default="$(arg debug)"/>
</include>
</launch>
Important: you have to check your auto-generated MOVIT_CONFIG_PKG/config/ros_controllers.yaml-File to have the same controller_list-name (here: arm_controller) as in your gazebo_controllers.yaml:
controller_list:
- name: arm_controller
action_ns: follow_joint_trajectory
default: True
type: FollowJointTrajectory
joints:
- joint_1
- joint_2
- ...
Hope I could help someone
Robert