The MuSHR simulator is the easiest way to get started with MuSHR. The simulated car can be either controlled via keyboard teleoperation, or by a control algorithm. This simulator is designed to emulate the car's configuration as close as possible to reduce sim-to-real overhead. To do so, many of the hardware components are programmatically simulated (camera is not simulated).
To make running the sim easier for various platforms we have provided a docker container with all the necessary components included. See below for setup.
To run the sim you will need to install docker from here and docker-compose found here. You will also need the host computer to have some nvidia driver. The default driver setup is for nvidia-390
. You can check your driver version in linux. You will also need git.
- Open up a terminal
- Check if docker is running:
docker run hello-world
. If not, run:
- Linux:
systemctl start docker
- Mac:
open /Applications/Docker.app
- Windows:
restart-service *docker*
- Clone this repo:
git clone https://github.com/prl-mushr/mushr_sim && cd mushr_sim/docker/
- Using your favorite text editor, change .env to your nvidia driver version number ingoring numbers past decimal and ones digit. For example, 341.2 would become 340
docker-compose up -d
This should create a container visible if you typedocker ps
A map with a car model and arrow of the car pose should now be visible in rviz and a small gray window should also appear.- Give it an initial pose using the "2D Pose Estimate" button at the top of the rviz window. And drive around using the WSDA keys while the small gray window is in focus
- To enter the container use
docker exec -it <container ID> bash
You will be the developer user. If you need to be root to download additional software rundocker exec -it -u 0 <container ID> bash
.
If you don't want to use a docker container on your linux system, you will need the following:
- ROS Melodic
- A catkin_ws
- rviz:
sudo apt-get install ros-melodic-rviz
- This repo
- mushr
- vesc
- mushr_base
- ackermann_msgs:
sudo apt-get install -y ros-melodic-ackermann-msgs
- map server:
sudo apt-get install -y ros-melodic-map-server
- serial:
sudo apt-get install -y ros-melodic-serial
- urg-node:
sudo apt-get install -y ros-melodic-urg-node
- robot state publisher:
sudo apt-get install -y ros-melodic-robot-state-publisher
- realsense description only
- Run all above bash commands, install ros melodic, and pull all repos into
catkin_ws/src
- Make packages:
cd ~/catkin_ws/ && catkin_make
- Source workspace:
. ~/catkin_ws/devel/setup.bash
- Launch sim:
roslaunch mushr_sim teleop.launch
- Launch rviz from a different terminal
rviz
Tutorials using the simulator can be found here.
For adjusting params see config
it has the simulated vesc params and also the sensor params for each car. If you don't find the publishers or subscribers you were looking for, they are likely in mushr_base.
Topic | Type | Description |
---|---|---|
/mux/ackermann_cmd_mux/input/teleop |
ackermann_msgs/AckermannDriveStamped | Publish teleop controls from keyboard |
/map |
nav_msgs/OccupancyGrid | Map from map server |
/map_metadata |
nav_msgs/MapMetaData | Map metadata |
/scan |
sensor_msgs/LaserScan | Simulated laser scan topic |
Topic | Type | Description |
---|---|---|
/tf |
tf2_msgs/TFMessage | Transforms for the laserscan |
/tf_static |
tf2_msgs/TFMessage | Static transforms for the laserscan |