This package is a collection of all setups used for demonstration purposes for my master thesis.
-
Two_distributed_rrbots: Consists of three robots. Each robots consists of 3 segments connected by 2 revolt revolution joints. All three robots are controlled by the central controller manager. However two of the rrbots are started in separate namespaces and are managed by a sub controller manager respectively. Those register at the central controller manager.
-
kuka_kr_16: Consist of a basic demonstration of the ros2_control concepts on the kuka kr 16 robot (forward_position_controller and joint_trajectory_controller).
If you are just interested how to start the demos themselves have a look below under the quickstart section.
- Update system:
sudo apt update sudo apt upgrade
- Install ROS 2 Rolling:
-
a) Either setup a Docker container with Rolling installed using RosTeamWS. If you use this method, don't forget to switch to your docker container before continuing with the
rtw_switch_to_docker
command. -
b) Or install ROS 2 Rolling directly on your computer.
- Make sure
colcon
andvcs
are installed:sudo apt install python3-colcon-common-extensions python3-vcstool
- Setup new workspace (If you used RosTeamWS and docker you can skip this step.):
mkdir -p ~/workspace/rolling_ws/src # or go to an existing one
- Clone this repo:
cd ~/workspace/rolling_ws/src git clone [email protected]:StoglRobotics-forks/ma_demos.git (Or gh repo clone StoglRobotics-forks/ma_demos)
- Make sure your base workspace is sourced and update dependencies:
source /opt/ros/rolling/setup.bash # source ws rosdep update # update dependencies
- Get the relevant packages and install all additional dependencies:
cd ~/workspace/rolling_ws/ # or your workspace base direcotry vcs import -w 1 src --skip-existing --input src/ma_demos/ma_demos.rolling.repos rosdep install --ignore-src --from-paths src -y -r
- Finally compile everything:
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
After you hav successfully built the project you can then start the demos as shown below.
-
Two_distributed_rrbots: Open first terminal and execute:
ros2 launch two_distributed_rrbots_bringup two_distributed_rrbots.launch.py
Then open the second terminal and execute:
ros2 launch two_distributed_rrbots_bringup test_two_distributed_rrbots_forward_position_controller.launch.py
-
kuka_kr_16: Open first terminal and execute:
ros2 launch kuka_kr16_2_bringup kuka_kr16_2.launch.py
Then open the second terminal and execute:
ros2 launch kuka_kr16_2_bringup test_kuka_kr16_2_forward_position_controller.launch.py
Or if you want to start the position_trajectory_controller:
- Load the controller by executing the following command:
ros2 control load_controller position_trajectory_controller
- Configure the newly loaded controller:
ros2 control set_controller_state position_trajectory_controller inactive
- Switch the forward_position_controller and the position_trajectory_controller:
ros2 control switch_controllers --deactivate forward_position_controller --activate position_trajectory_controller
- Check that everything is loaded as planned:
Which should print something like this:
ros2 control list_controllers
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active forward_position_controller[forward_command_controller/ForwardCommandController inactive position_trajectory_controller[joint_trajectory_controller/JointTrajectoryController] active
Finally: Start the controller execution with:
ros2 launch kuka_kr16_2_bringup test_kuka_kr16_2_joint_trajectory_controller.launch.py
- Load the controller by executing the following command: