Skip to content

RePAIRProject/repair_ros_robot

Repository files navigation

RePAIR ROS Robot

1) Description

This repository contains the software to control the simulated and real RePAIR robot.

Dependencies

2) Installation

  • Clone the repository along with the submodules

     mkdir -p ~/repair_robot_ws/src && cd ~/repair_robot_ws/src
    
     git clone --recurse-submodules -j8 https://github.com/RePAIRProject/repair_ros_robot.git
  • Install required Python packages

     cd ~/repair_robot_ws/src/repair_ros_robot
     pip3 install -r requirements.txt
  • Build the workspace

    • source ROS (source /opt/ros/noetic/setup.bash) in all terminals
     cd ~/repair_robot_ws
    
     catkin build
    • After successful build, source the workspace in all the terminals
     cd ~/repair_robot_ws
    
     source devel/setup.bash
    
  • For Gazebo:

    • Copy the fragment model folder from repair_urdf/sdf/frag3 to ~/.gazebo/models/frag3.
    • Change the path in file pysdf/src/pysdf/parser.py line 26 to your catkin_ws src path.
  • Install XBot2 to use the real robot drivers (Source)

     sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    
    sudo apt install curl 
    curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
    
    sudo apt update && sudo apt install -y \
    ros-noetic-ros-base \
    libgazebo11-dev
    
    echo ". /opt/ros/noetic/setup.bash" >> ~/.bashrc
    
    source $HOME/.bashrc
    sudo apt install -y \
    ros-$ROS_DISTRO-urdf ros-$ROS_DISTRO-kdl-parser \
    ros-$ROS_DISTRO-eigen-conversions ros-$ROS_DISTRO-robot-state-publisher ros-$ROS_DISTRO-moveit-core \
    ros-$ROS_DISTRO-rviz ros-$ROS_DISTRO-interactive-markers ros-$ROS_DISTRO-tf-conversions ros-$ROS_DISTRO-tf2-eigen \
    qttools5-dev libqt5charts5-dev qtdeclarative5-dev
    
    sudo sh -c 'echo "deb http://xbot.cloud/xbot2/ubuntu/$(lsb_release -sc) /" > /etc/apt/sources.list.d/xbot-latest.list'
    wget -q -O - http://xbot.cloud/xbot2/ubuntu/KEY.gpg | sudo apt-key add -  
    sudo apt update
    sudo apt install xbot2_desktop_full
    
    echo ". /opt/xbot/setup.sh" >> ~/.bashrc
  • Setup XBot2 to use the real robot drivers set_xbot2_config ~/repair_robot_ws/src/repair_ros_robot/repair_cntrl/config/repair_basic.yaml

For docs on repair_interface, go to the repair_interface.

3) Usage

RVIZ

RVIZ visualization with joint sliders

roslaunch repair_urdf repair_full_slider.launch 

RVIZ visualization without joint sliders

roslaunch repair_urdf repair_full.launch

Gazebo simulation

View the robot in Gazebo

roslaunch repair_gazebo repair_gazebo.launch
  • You can ignore the following error messages, the model uses position controllers while p gains are only needed for effort controllers [ERROR] [1675347973.116238028]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/x_joint

Motion planning and execution with Moveit and ros_control in Gazebo

roslaunch repair_gazebo bringup_moveit.launch
  • You can ignore the following error messages, the model uses position controllers while p gains are only needed for effort controllers [ERROR] [1675347973.116238028]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/x_joint

XBot2

XBot2 is required when you want to control the real robot. Furthermore, there is a dummy mode that can be used to emulate the real robot interface. Using the dummy mode allows to use RVIZ with Moveit with the real robot controls instead of ros_control. Currently, this repository does not support using the dummy mode with Gazebo.

Dummy mode

  • First, you have to configure your .bashrc so that the roscore is running on your local machine. For this purpose, add the following lines to your .bashrc.

     export ROS_MASTER_URI=http://{local_IP}:11311
     export ROS_IP={local_IP}
  • Then, source your .bashrc and start the roscore in window 1.

     roscore
  • Start XBot2 in window 2.

     xbot2-core --hw dummy
  • Now you you have to start the bridge between XBot2 and ROS in window 3.

     rosrun repair_moveit_xbot moveit_xbot_bridge_node
  • Finally, in window 4 you can start RVIZ and Moveit to control the emulated robot.

     roslaunch repair_moveit_xbot bringup_moveit.launch

Real robot

  • First, you have to configure your .bashrc so that the roscore is running on the robot PC. For this purpose, add the following lines to your .bashrc.

     export ROS_MASTER_URI=http://{robot_IP}:11311
     export ROS_IP={local_IP}
  • Then, source your .bashrc and connect via ssh to the real robot PC. You will need at least 3 remote command windows.

     ssh -X {host_name}@{robot_IP}
  • Check in remote window 1 that the roscore is running. In case the roscore is not running you can restart it using the system command systemctl --user restart roscore.service

     rostopic list
  • Then used the same window to start the ecat_master.

     ecat_master
  • Now start XBot in remote window 2

     xbot2-core --hw ec_pos

    This starts the motors to be controllable with position control. Alternatively you can start them in idle mode using xbot2-core --hw idle

  • Now you have to manually start the motor cooling fans in remote window 3.

     rosservice call /ec_client/set_motors_fan "motor_name: ['']
     position: [0]
     velocity: [0]
     torque: [0]
     amperage: [0]
     homing_position: [0]
     fan: [true]
     led: [false]"
  • On your local PC you will need at least 3 command windows. In command window 1, you have to open the robot GUI. Here, you have to move the robot to the home position by clicking on the Home button.

     xbot2-gui
  • In local window 2 you have to start the bridge between XBot and Moveit.

     rosrun repair_moveit_xbot moveit_xbot_bridge_node
  • Afterwards, you can start Moveit in local window 3.

     roslaunch repair_moveit_xbot bringup_moveit.launch

Run the pick and place demo

The goal of the demo is to pick and place a fresco fragment. There are 2 versions of the demo. The manual demo is moving to fixed poses while the moveit demo is using a perception pipeline to determine a grasp pose. Both demos can be run in Gazebo or with the real robot. For this purpose the gazebo argument has to be set accordingly. The side argument defines whether the left or the right hand is used to grasp the fragment.

Without perception

roslaunch repair_interface manual_test.launch side:=right gazebo:=false

With perception

First you have to move the arms and hands out of the field of view of the torso camera. Afterwards you can execute the following script.

roslaunch repair_interface moveit_test.launch side:=right gazebo:=false

In the beginning two windows will pop up which you have to close by pressing the q button.

Information about used topics

  • To inspect all the topics exposed by xbot2 run rostopic list:
  • Send commands to the joints (SoftHand excluded) using /xbotcore/command topic
  • Read joint states (SoftHand excluded) using /xbotcore/joint_states topic
  • Send commands to the SoftHans using /{left/right}_hand_v1s/synergy_command topic, or inspect the state of each finger looking at /{left/right}_hand_v1s/{fingername}_state topic

4) Known Issues

  • The URDF does not reflect the real robot yet.
  • The planning parameters have to be optimized so that the robot does not stop between subsequent poses.

5) Relevant publications

T.B.A.