Code for the paper "Collaborative Object Transportation in Space via Impact Interactions"
The project page can be found here, the paper can be found here.
The code, while being a ROS2 package in its entirety, consists of two distinct parts;
impact_stl/plannerwhich generates the desired motion plans and writes them to.csvfilesimpact_stl/impact_stlwhich is the ROS2 package that reads the.csvfiles and executes them in SITL or on the real platform.
The only proprietary dependency is gurobi which is only required for impact_stl/planner to solve the Mixed-Integer Problem. If you do not want or cannot obtain a gurobi license, there are generated .csv files in impact_stl/impact_stl/planner/plans for all the scenarios described in the paper, and more!
If you have a gurobi license and you are interested in only generating the motion plans, you can build a virtual environment using the environment.yml file in impact_stl/planner
conda env create -f environment.yml
To run the SITL or hardware simulations, I have provided a DockerFile in DockerFiles. This image requires approximately 15Gb of storage as it installs, among others, ros2, gazebo, and px4-space-systems.
docker build -t impact_stl:latest -f DockerFiles/Dockerfile .
docker run -it --gpus all --network=host --ipc=host -e DISPLAY=$DISPLAY -e NVIDIA_VISIBLE_DEVICES=all -e NVIDIA_DRIVER_CAPABILITIES=all -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix:rw -v /dev/dri:/dev/dri -e XDG_RUNTIME_DIR=/tmp/runtime-root --runtime=nvidia -v /home/none/gits/PROJECTS/impact_stl:/home/px4space/space_ws/src/impact_stl --name impact_stl_cont impact_stl
The last argument links your local clone of the impact_stl repository to the Docker container. You can change the path to your local clone of the repository.
To run the planner, you need to activate the conda environment and run the main.py script.
The script allows you to change robustness type and scenario. See the World.py and Spec.py for details on how to change the scenarios.
In the impact_stl directory, run the following commands:
conda activate impact_stl
python main.py
The simulator requires several components to be running. We list them here:
QGroundControlwhich is the ground control station for the PX4 autopilot, allowing us to arm, disarm, and change the control mode of the vehicle.microroswhich is the micro-ROS agent that allows us to communicate with the PX4 autopilot.sitl launch filewhich is the launch file that starts the PX4 autopilot in software-in-the-loop (SITL) mode.scenario launch filewhich is the launch file that starts the all the controllers, planners, impact detectors etc.start launch filewhich sends the global signal that the simulation should start. Also records the rosbag.
In the home directory, run the following command to start QGroundControl:
./startQGC
In any directory, run the following command to start the micro-ROS agent:
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
Go to the space_ws directory, and build the workspace:
colcon build
Source the workspace:
source install/setup.bash
Then, run the following command to start the PX4 autopilot in SITL mode:
ros2 launch impact_stl sitl_obstacle_avoidance.launch.py
In the impact_stl directory, run the following command to start the scenario:
ros2 launch impact_stl obstacle_avoidance.launch.py
In the impact_stl directory, run the following command to start the simulation:
ros2 launch impact_stl start_scenario.launch.py
If you have access to the ATMOS platform, you can also run the code on the platforms. The only difference is that you need to launch the hw_obstacle_avoidance.launch.py file instead of the sitl_obstacle_avoidance.launch.py file (and you can skip micro-ros as this is run on the robots).
Some things to note:
- You might need to change the restitution coefficient in the planner and replaner to match the hardware. We recently changed the robot's bumpers, so I will update these values soon.
Install the intel realsense package
sudo apt install ros-humble-librealsense2*
sudo apt install ros-humble-realsense2-*
and start the camera (when connected to your PC via USB) with ros2 launch realsense2_camera rs_launch.py publish_tf:=true
If you found this code useful, please consider citing our paper:
@article{verhagen2025collaborative,
title={Collaborative Object Transportation in Space via Impact Interactions},
author={Verhagen, Joris and Tumova, Jana},
journal={Robotics: Science and Systems},
year={2025}
}
