- Gazebo
- Rviz2
- Python-Websocket to ROS2 interface
- docker
- docker-compose
- VSCode
- Dev Containers VSCode extension
- Postman (Optional)
Inside vscode, with Dev Containers installed press ctrl+shift+P and type 'rebuild and reopen in container'. Wait until docker build the container and then in a new terminal run:
cd main
pip3 install -r requirements.txt
Inside a terminal run:
gazebo --verbose /opt/ros/iron/share/gazebo_plugins/worlds/gazebo_ros_diff_drive_demo.world
In another terminal inside /main, to make the robot move run:
python3 start.py
And to stop it run:
python3 stop.py
In a terminal inside /main, run:
python3 websocket-ros2-interface.py
It should print "Server started at ws://{local_ip}:{port}". From a WebSocket Client connect to ws://{local_ip}:{port}/{client_name} and send a json with this format:
{
"acceleration": {
"x": 1.0,
"y": 2.0,
"z": 3.0
},
"angular_velocity": {
"x": 0.1,
"y": 0.2,
"z": 0.3
}
}
Finally you can check if this worked from ROS:
ros2 topic echo imu_data