A robot soccer game simulation environment based on CoppeliaSim.
I tested on the below environment.
- Ubuntu 20.04
- Python 3.8
- PyTorch 1.11.0
-
CoppeliaSim
Refer to
Installation
andBuild
part of robomaster_sim. CoppeliaSim Edu 4.4.0 is recommended. -
Python Packages
A virtual environment
venv
is recommended ( Anaconda is not recommended).-
RoboMaster: Refer to Robomaster SDK.
-
Gym:
pip install gym[all]
-
PyTorch: >=1.11
-
(optional) stable baselines 3:
pip install stable-baselines3[extra]
-
- Start CoppeliaSim in your folder
./CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu20_04/coppeliasim.sh
sudo ifconfig lo:0 127.0.1.1/8 up
sudo ifconfig lo:1 127.0.1.2/8 up
sudo ifconfig lo:2 127.0.1.3/8 up
- Press PLAY in CoppeliaSim.
- Try this to test if everything in CoppeliaSim is fine.
simRobomaster.set_target_twist(0, {x=0.2, y=-0.1, theta=0.1})
simRobomaster.move_arm(0, 1, 1, true)
simRobomaster.open_gripper(int robot_handle, bool wait=true)
simRobomaster.close_gripper(int robot_handle, bool wait=true)
simRobomaster.set_gripper_target(int handle, string state, float power=0.5)
- Run the python script
simpleTest.py
inCoppeliaSim
folder to test if everything is fine.
Just run test.py
in GymEnv
to test.
Some commonly used functions are in CoppeliaSim Legacy remote API.pdf.
https://robomaster-dev.readthedocs.io/zh_CN/latest/index.html