This repository contains the software to control the simulated and real RePAIR robot.
- catkin
- xacro
- Xbot2
- Softhand-plugin
- roboticsgroup_upatras_gazebo_plugins
- gazebo2rviz
- pysdf
- [realsense] (https://github.com/issaiass/realsense2_description)
- moveit
- install ddynamical reconfigure
sudo apt-get install ros-noetic-ddynamic-reconfigure
- realsense2_camera is available as a debian package of ROS distribution. It can be installed by typing:
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera
- realsense_gazebo_plugin
-
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
Troubleshooting If you get errors during build similar to (where package name is some name):CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "package_name" with any of the following names: package_nameConfig.cmake package_name-config.cmake Add the installation prefix of "package_name" to CMAKE_PREFIX_PATH or set "package_name" to a directory containing one of the above files. If "package_name" provides a separate development package or SDK, be sure it has been installed.
Check the list below:
From this issue it looks like it should be installed by running:
sudo apt-get install ros-noetic-ddynamic-reconfigure
Install moveit by
sudo apt-get install ros-noetic-moveit
Install it by
sudo apt-get install ros-noetic-rviz-visual-tools
Install it by
sudo apt-get install ros-noetic-moveit-visual-tools
- After successful build, source the workspace in all the terminals
cd ~/repair_robot_ws source devel/setup.bash
- source ROS (
-
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
line26
to yourcatkin_ws
src path.
- Copy the fragment model folder from
-
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.
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
roslaunch repair_gazebo bringup_moveit.launch launch_gazebo:=true sh_version:=v1_2_research fixed_hands:=false
launch_gazebo:=true/false
(defaultfalse
): iftrue
launches Gazebo for simulation, iffalse
(default) real robotsh_version:=v1_2_research/v1_wide/mixed_hands
(defaultv1_2_research
): to use standard (small) hand/wide hand/standard hand on right and wide hand on leftfixed_hands:=true/false
(defaulttrue
):true
is needed for planning with real robot, but you cannot plan in simulation, set it tofalse
to plan in Gazebo
- 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
- You can ignore the warning messages about unknown links in URDF (e.g.
[ WARN] [1706696422.918657977, 1.124000000]: Link 'right_hand_v1_2_research_thumb_proximal_link' is not known to URDF. Cannot disable/enable collisons.
), they doesn't affect the run of the simulation, you won't only be able to see the hand opening/closing in Rviz
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.
-
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
-
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
-
Finally use the following to start the gui:
xbot2-gui
-
On your local PC you will need at least 3 command windows.
-
First, you can start Moveit:
roslaunch repair_moveit_xbot bringup_moveit.launch
-
Furthermore, start the moveit server:
rosrun repair_interface moveit_client.py
-
In order to run the camera, use:
roslaunch realsense2_camera demo_pointcloud_new.launch
-
Finally, In Order to use the Fresco recognition, run:
rosrun repair_interface sand_detection.py
Now the szstem is set-up, and other code can be started!
-
To increase/reduce the number of points for a trajectory, update the following parameter for
arm_1
andarm_2
in repair_moveit_config_v2/config/ompl_planning.yamllongest_valid_segment_fraction: 0.00005
-
To increase/decrease the velocity of arm joints, update the following parameter in repair_moveit_config_v2/config/joint_limits.yaml
default_velocity_scaling_factor: 0.1 default_acceleration_scaling_factor: 0.1
-
Alternatively, velocity and acceleration scaling factors can be updated in the Rviz Motion Planning plugin before planning a path.
The goal of the demo is to pick and place any number of fresco fragments.
rosrun repair_interface moveit_multi_fresco_cleaned.py
Note: sh_version options are [v1_2_research, v1_wide, mixed_hands]
To run recognition, a few files need to be added (ask Luca Palmieri for the files):
- RPf_00123 to RPf_001266 should be added to
repair_ros_robot/repair_urdf/sdf
- RPf_00123 to RPf_001266 should also be added to
/home/.gazebo/models
- The fragment database directory
fragments_db
should be added to/home/.gazebo
- 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
- Translation axis needs to be included
T.B.A.