Skip to content

MyGitHubSite/mushr_sim

 
 

Repository files navigation

Build Status

MuSHR Simulator

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.

Install (Docker)

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.

  1. Open up a terminal
  2. 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*
  1. Clone this repo: git clone https://github.com/prl-mushr/mushr_sim && cd mushr_sim/docker/
  2. 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
  3. docker-compose up -d This should create a container visible if you type docker 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.
  4. 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
  5. 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 run docker exec -it -u 0 <container ID> bash.

Install (Non-Docker)

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
  1. Run all above bash commands, install ros melodic, and pull all repos into catkin_ws/src
  2. Make packages: cd ~/catkin_ws/ && catkin_make
  3. Source workspace: . ~/catkin_ws/devel/setup.bash
  4. Launch sim: roslaunch mushr_sim teleop.launch
  5. Launch rviz from a different terminal rviz

Tutorials

Tutorials using the simulator can be found here.

API

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.

Publishers

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

Subscribers

Topic Type Description
/tf tf2_msgs/TFMessage Transforms for the laserscan
/tf_static tf2_msgs/TFMessage Static transforms for the laserscan

Releases

No releases published

Packages

No packages published

Languages

  • Python 62.9%
  • CMake 34.4%
  • Dockerfile 2.7%