0
$\begingroup$

Rosanswers logo

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

Originally posted by epsilonjon on ROS Answers with karma: 123 on 2017-01-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

For anyone in a similar boat, I figured out what the problem was.

I was misunderstanding how ROS Control worked, so in my RobotHW I was looking at the joint's position and expecting this to be changing. What is ACTUALLY changing the the joint's position_command. Since I don't have any feedback on my arm servos, I just write position_command straight into position and now everything works.


Originally posted by epsilonjon with karma: 123 on 2017-01-27

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by mikevillan26 on 2018-12-14:
Can we discuss more in detail what you mean? I have a wireless microcontroller reading joint_state data from an ABB robot and sending it directly to a remote ros server. I'm able to see the robots live position by using 'rostopic echo joint_states' but I'm unable to visualize its movements in Rviz.

Comment by gvdhoorn on 2018-12-14:
I would advise you to -- after verifying that none of the other Q&As cover it -- post a new question, instead of a comment on an almost 2 year old question. Comments have almost no visibility.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.