MoveIt tutorial - Moveit! through bridges

NOTE: Work in progress. We're continuously improving the documentation, stay tuned for updates

MoveIT! is not yet available for ROS 2.0. For now, if you want to use it with MARA, you'll need to launch a set of nodes to create a bridge between ROS and ROS 2.0. It's quite complex to configure, please be pacient.

You can run gazebo, spawn the model, publish the robot state and run hros_cognition_mara_components using the ROS 2.0 launch file. You can choose one of the following ros2 launch depends on the gripper that you want to use:

source ~/ros2_mara_ws/install/setup.bash
ros2 launch mara_gazebo mara.launch.py
ros2 launch mara_bringup mara_gripper_140.launch.py
ros2 launch mara_bringup mara_gripper_85.launch.py
ros2 launch mara_bringup mara_gripper_hande.launch.py

We need to run this node to create a bridge between ROS and ROS 2.0. The topics that will be available are /mara_controller/state, /joints_state and hros_actuation_servomotor_*********/trajectory. Type the following command to run the bridge:

source /opt/ros/kinetic/setup.bash
source ~/ros2_mara_ws/install/setup.bash
ros2 run individual_trajectories_bridge individual_trajectories_bridge -motors `ros2 pkg prefix individual_trajectories_bridge`/share/individual_trajectories_bridge/motors.yaml

You can run the four needed nodes using this launch file. You should use the argument prefix to indicate which gripper you are using 85, 140 or hande:

source ~/ros_mara_ws/install_isolated/setup.bash
roslaunch mara_bringup mara_bringup_moveit.launch prefix:=85

We need to launch two nodes in ROS 2.0. One is the bridge between ROS and ROS 2.0, and the other one is the node that fetches all the states from the motors and create a topic called /mara_controller/state.

We need to run this node to create a bridge between ROS and ROS 2.0. The topics that will be available are /mara_controller/state, /joints_state and hros_actuation_servomotor_*********/trajectory. Type the following command to run the bridge:

source /opt/ros/kinetic/setup.bash
source ~/ros2_mara_ws/install/setup.bash
ros2 run individual_trajectories_bridge individual_trajectories_bridge -motors `ros2 pkg prefix individual_trajectories_bridge`/share/individual_trajectories_bridge/motors.yaml

This ROS 2.0 node will fetch all the hros_actuation_servomotor_*********/state topics defined in the config file and these topics' data will be republished in a topic called /mara_controller/state. This node will also subscribe to /mara_controller/command and it will republish the data in to the corresponding H-ROS topic hros_actuation_servomotor_*********/goal. To run this ROS 2.0 just type:

source ~/ros2_mara_ws/install/setup.bash
ros2 run hros_cognition_mara_components hros_cognition_mara_components -motors `ros2 pkg prefix hros_cognition_mara_components`/share/hros_cognition_mara_components/link_order.yaml

Right now, we need the nodes to run MoveIt!. We should execute the following nodes for setting up the robot_description parameter, a node that handles the topic follow_joint_trajectory, the MoveIT nodes and finally RVIZ to move the robot.

This node will set the robot_description parameter. MoveIt makes use of this parameter to calculate the forward and inverse kinematics.

source ~/ros_mara_ws/install_isolated/setup.bash
roslaunch mara_bringup mara_bringup.launch

This node will handle the follow_joint_trajectory topic. It is subscribed to this topic and will republish the data in the corresponding hros_actuation_servomotor_*********/trajectory.

source ~/ros_mara_ws/install_isolated/setup.bash
rosrun mara_bringup follow_joints_individual_trajectory.py

This terminal will launch MoveIt!.

source ~/ros_mara_ws/install_isolated/setup.bash
roslaunch mara_moveit_config mara_moveit_planning_execution.launch

If you want to use RVIZ to move the robot, you'll need to type the following instructions:

source ~/ros_mara_ws/install_isolated/setup.bash
roslaunch mara_moveit_config moveit_rviz.launch config:=true