This guide provides step-by-step instructions for installing the RoboMaster Simulation running in CoppeliaSim using Pixi.
- Download CoppeliaSim for Apple Silicon or Intel
- Unzip and move to
/Applications/coppeliaSim.app
- Right-click on
coppeliaSim.app
-> Open -> Open - CoppeliaSim must be launched from the Terminal (this will become important later):
/Applications/coppeliaSim.app/Contents/MacOS/coppeliaSim
- Download CoppeliaSim for Ubuntu 22.04 or Ubuntu 24.04
- Extract CoppeliaSim in a directory of your choice, for example in your
COURSE_FOLDER
:cd <COURSE_FOLDER> tar xvf CoppeliaSim_Edu_V4_7_0_rev4_Ubuntu<UBUNTU_VERSION>.tar.xz
- CoppeliaSim must be launched from the Terminal (this will become important later):
<PATH_TO_COPPELIA>/CoppeliaSim_Edu_V4_7_0_rev4_Ubuntu<UBUNTU_VERSION>/coppeliaSim.sh
We prepared a Pixi project for you with all required dependencies for using the RoboMaster in CoppeliaSim. You can set it up by cloning this repository:
git clone [email protected]:idsia-robotics/robotics-lab-usi-robomaster.git --recursive
Ubuntu: You need to customize the COPPELIASIM_ROOT_DIR
in the pixi.toml
of this repo to point to your CoppeliaSim installation.
Now enter the repository, compile and install the packages:
cd robotics-lab-usi-robomaster
pixi install
pixi shell
colcon build --symlink-install
You can launch CoppeliaSim with this command. This is important to ensure that Coppelia is started with the correct environment variables to see the ROS packages installed in this repo:
source install/setup.zsh
pixi run coppelia
- Open CoppeliaSim.
- Add a RoboMaster to the scene via:
Model browser (the left sidebar) -> robots -> mobile -> RoboMasterEP
- Press play and ensure no errors are printed in the Coppelia log (Bottom).
With CoppeliaSim running and a Robomaster in the scene, run:
cd src/robomaster_sim/examples
pixi shell
python discover.py
This script should find the RoboMaster in the scene, print some info about it, and close itself.
- macOS 15: This macOS update introduced stricter controls on local network access, which the RoboMaster ROS driver needs to communicate with the RoboMaster model in Coppelia. If communication fail with
ERROR conn.py:107 scan_robot_ip: exception timed out
, please check that your terminal app (e.g. Terminal, iTerm, Visual Studio Code) is authorized to access the local network. Go in System Settings.app -> Privacy & Security -> Local Network and add / enable your terminal app.
You're ready to start using your simulated RoboMaster. While the simulation is running as described in the previous step, launch the RoboMaster ROS driver:
source install/setup.zsh
ros2 launch robomaster_ros ep.launch
In another terminal, inside the <ROS_PROJECT_FOLDER>
.
pixi shell
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.5}}"
The robot should start to rotate counter-clockwise.
Use this command to stop it:
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"
Your installation is complete! 🎉