Conceptual diagram
Implementation example diagram
First the installation of ROS2
To simulate, it is crucial to first have ROS 2 properly installed and the environment prepared. If you do not have an environment set up, create a script named ros2_setup.sh
. Copy and paste the following code into the script, and place the ros2_setup.sh
script in the Home directory on your computer.
source /opt/ros/humble/setup.bash
source /usr/share/colcon_cd/function/colcon_cd.sh
export _colcon_cd_root=~/ros2_install
export ROS_DOMAIN_ID=40
source ~/wsr2/install/setup.bash
cd ~/wsr2
Request access to engineer Federico Ruiz Ugalde for the following repositories, then clone to the src
directory inside wsr2
.
Request access:
Once you have access, download the repositories and other requirements.
sudo apt-get install python-is-python3 ipython3 python3-pip git ros-humble-xacro
mkdir -p ~/local/src/repos/gitlab/arcoslab
cd ~/local/src/repos/gitlab/arcoslab
git clone https://gitlab.com/arcoslab/python_robot_misc_utils.git
cd python_robot_misc_utils
pip3 install -e .
Note: In case you have write permission to this repository use the following command for cloning instead of the previous one:
git clone git@gitlab.com:arcoslab/python_robot_misc_utils.git
mkdir -p ~/wsr2/src
cd ~/wsr2/src
git clone git@gitlab.com:arcoslab/arcos-lab-cognitive-architecture/ros2-generic-multi-joint-impedance-control-virtual-robot.git
mkdir -p ~/wsr2/src
cd ~/wsr2/src
git clone https://gitlab.com/open-wessling-drivers/wessling_hand_driver.git
mkdir -p ~/wsr2/src
cd ~/wsr2/src
git clone git@gitlab.com:arcoslab/arcos-lab-cognitive-architecture/robot-body-coupler/robot-body-coupler.git
cd
source ros2_setup.sh
cd ~/wsr2
colcon build --packages-select rbc_msgs_srvs
cd
source ros2_setup.sh
cd ~/wsr2
colcon build
mkdir -p ~/wsr2/src
cd ~/wsr2/src
git clone git@gitlab.com:arcoslab/arcos-lab-cognitive-architecture/arcos-lab-humanoid-startup.git
cd
source ros2_setup.sh
cd ~/wsr2
colcon build
sudo apt-get install python3-pykdl
pip3 install quaternionic
Since we are trying to simulate the robot as near as possibly to the real one we developed separated simulation ROS2 modules for each robot hardware part:
mkdir -p ~/wsr2/src
cd ~/wsr2/src
git clone https://gitlab.com/arcoslab/robot-hardware-firmware/kuka-lwr4plus.git
cd
source ros2_setup.sh
cd ~/wsr2
colcon build
Note: In case you have write permission to this repository use the following command for cloning instead of the previous one:
git clone git@gitlab.com:arcoslab/robot-hardware-firmware/kuka-lwr4plus.git
mkdir -p ~/wsr2/src
cd ~/wsr2/src
git clone https://gitlab.com/open-wessling-drivers/wessling_hand_driver.git
Note: In case you have write permission to this repository use the following command for cloning instead of the previous one:
git clone git@gitlab.com:open-wessling-drivers/wessling_hand_driver.git
mkdir -p ~/wsr2/src
cd ~/wsr2/src
git clone https://gitlab.com/arcoslab/robot-hardware-firmware/arcos-lab-mobile-platform.git
cd
source ros2_setup.sh
cd ~/wsr2
colcon build
Note: In case you have write permission to this repository use the following command for cloning instead of the previous one:
git clone git@gitlab.com:arcoslab/robot-hardware-firmware/arcos-lab-mobile-platform.git
Downloading this repository may be necessary for two things:
mkdir -p ~/local/src/repos/gitlab/arcoslab/robot-hardware-firmware/open-coroco/
cd ~/local/src/repos/gitlab/arcoslab/robot-hardware-firmware/open-coroco/
git clone git@gitlab.com:arcoslab/robot-hardware-firmware/open-coroco/open-coroco-software.git
cd open-coroco-software
git checkout humanoid-platform
cd utils
sudo cp 50-opencoroco.rules /etc/udev/rules.d/
sudo udevadm control --reload
cd ..
cd python-opencoroco/
pip install -e .
Stop here for the simulating the robot
Continue if you want to reprogram the real open-coroco controllers (advanced) (only for real robot)
sudo apt-get install python3-serial
cd examples
./open-coroco-pc.py -d /dev/ttyOC0
cd ..
cd ..
sudo apt-get install gcc-arm-none-eabi
git submodule init
git submodule update
cd lib/libopencm3
make -j`nproc`
cd ../libopencm3-plus
make -j`nproc`
cd ../../
Step 1
source ros2_setup.sh
Step 2
colcon build
In a new console, Run RVIZ2
Step 1
cd
Step 2
source ros2_setup.sh
Step 3
ros2 run rviz2 rviz2
In another console run the robot body simulator:
Step 1
cd
Step 2
source ros2_setup.sh
Step 3
ros2 launch arcos-lab-humanoid-startup-sim arcos-lab-humanoid-startup-sim.launch.py
In another console run the robot platform simulator:
Step 1
cd
Step 2
source ros2_setup.sh
Step 3
ros2 launch arcos_lab_mobile_platform arcos_lab_mobile_platform_sim.launch.py
In another console run the RBC:
Step 1
cd
Step 2
source ros2_setup.sh
Step 3
ros2 launch rbc rbc.launch.py
Remember: Make sure you have your SSH keys configured in your GitLab account for authentication to work correctly.
It is important from time to time to apply the following command.
sudo apt upgrade
Step 1
Fixed Frame - odom
Step 2
Add - RobotModel - OK
Step 3
Description Topic - /robot_description
Step 4
Ready-to-use RViz interface
Remember to put the mobile platform on "Mode 0" (look on previous steps)
ros2 service call /arcoslab_platform_torso/control impedance_control_msgs/srv/Modes "enable: [True, True, True, True, True]
mode: 0"
There are two examples: rbc_joint_init and rbc_keyboard_ctrl
rbc_joint_init: takes one robot arm away from kinematic singularities. Or: starts the robot, using joint position control, on a know well-behaved starting pose. This is necessary for running the second program (or doing cartesian control)
rbc_keyboard_ctrl: the user can use various keyboard keys to control a robot end-effect, using cartesian position control, to a desired position. It is necessary to run rbc_joint_init at least once before starting to use this program.
cd ~/wsr2/src/
git clone git@gitlab.com:arcoslab/arcos-lab-cognitive-architecture/robot-body-coupler/robot-body-coupler-client-examples.git
cd ~
- Instructions (for simulation)
- Rviz Configuration
In another console run the RBC.
Step 1
cd
Step 2
source ros2_setup.sh
Step 3
cd ~/wsr2/src/robot-body-coupler-client-examples/rbc_joint_init/rbc_joint_init/
./rbc_joint_init.py
The robot should "arc" the arm from up looking down. Wait until the program finishes.
The program should print "Goal reached!!! yei!"
In another console run the RBC.
Step 1
cd
Step 2
source ros2_setup.sh
Step 3
cd ~/wsr2/src/robot-body-coupler-client-examples/rbc_keyboard_ctrl/rbc_keyboard_ctrl/
./rbc_keyboard_ctrl.py
Wait until the program stops printing (initialization)
Step 4
rbc_keyboard_ctrl.py