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

If you want your robot work in gazebo you can follow this tutorial to add a controller in simulation. You need to add some gazebo tag in your .urdf file. Add the

  <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>, the effort_controllers may be  a little bit hard to configure the pid parameter .

than in your .yaml file

    kr60_3_model:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  

  kr60trajectory_controller:
    type: "position_controllers/JointTrajectoryController"
    joints:
      - joint_1
      - joint_2
      - joint_3
      - joint_4
      - joint_5
      - joint_6

This is my controller launch file. launch a JointTrajectoryController.

    <launch>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find kr60_3_control)/config/kr60_3_control.yaml" command="load"/>

  <!-- load the controllers -->

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

  <!-- 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">
    <remap from="/joint_states" to="/kr60_3_model/joint_states" />
  </node>

</launch>