This repository provides a simulated vehicle model of the Polaris GEM e2 Electric Cart in the Gazebo simulation environment as well as ROS based sensors and controllers for autonomous driving. The Polaris GEM e2 vehicle model was measured and modeled using SolidWorks by Hang Cui and Jiaming Zhang. Hang Cui further constructed the URDF files of the vehicle model compatible with ROS, RViz, and Gazebo.
The simulator was initially developed for personal research with ROS Melodic and Gazebo 9 in Ubuntu 18.04 in Fall 2019. This simulator then became an essential teaching material for the course, Principles of Safe Autonomy @ Illinois, and the project subsequently received funding from the Center for Autonomy at University of Illinois at Urbana-Champaign. Hang Cui further developed and upgraded the simulator to use ROS Noetic and Gazebo 11 in Summer 2021. This simulator is currently under active development for research and teaching.
This fork additionally provides:
- A prebuilt Docker image for one-command bring-up.
- A suite of rostest + Gazebo safety scenarios (Battery, Temperature, GPS, Network, Emergency Stop) and an integration test (StateManager × Planner).
- A (WIP) vision-based lane keeping node (
vision_lka) that tracks road markings from the front camera and publishes Ackermann commands.
Our simulation setup is currently tested with the following system and ROS packages.
System: Ubuntu 20.04/22.04 + ROS Noetic (Gazebo 11)
We refer readers to http://wiki.ros.org/noetic/Installation/Ubuntu and follow the instructions to install ROS Noetic and Gazebo 11.
We also recommend Desktop-Full Install as suggested in the instructions.
Required ROS Packages (for native installs):
ackermann_msgsgeometry2hector_gazebohector_modelsjsk_rviz_pluginsros_controlros_controllersvelodyne_simulator
After installing ROS Noetic and Gazebo 11 on Ubuntu 20.04, we recommend installing ROS packages using APT as follows:
sudo apt install ros-noetic-ackermann-msgs ros-noetic-geometry2 \
ros-noetic-hector-gazebo ros-noetic-hector-models ros-noetic-jsk-rviz-plugins \
ros-noetic-ros-control ros-noetic-ros-controllers ros-noetic-velodyne-simulatorThis is the fastest path for reviewers.
- Pull the image:
docker pull execbat/ros_vehicle_final:latest- Allow X11 for GUI apps:
xhost +local:root- Run the container:
sudo docker run -it --rm --net=host \
-e DISPLAY=$DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
--device /dev/dri \
execbat/ros_vehicle_final:latest \
bash -lc "source /ros_entrypoint.sh && bash"- Inside the container, build and launch:
source /opt/ros/noetic/setup.bash
catkin_make
source devel/setup.bash
roslaunch gem_gazebo gem_gazebo_rviz.launch velodyne_points:=trueNVIDIA GPUs: install
nvidia-container-toolkitand append--gpus allto thedocker runcommand.
Wayland/WSL/macOS: you need a running X server and properDISPLAYforwarding.
Use this if you prefer to build the workspace yourself inside a clean ROS image.
- Start a clean ROS desktop container:
docker pull ros:noetic-desktop-full
xhost +local:root
sudo docker run -it --rm --net=host \
-e DISPLAY=$DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
--device /dev/dri \
ros:noetic-desktop-full \
bash- Inside the container, prepare tools and workspace:
# tools
apt-get update && apt-get install -y git python3-rosdep build-essential
rosdep init || true
rosdep update
# workspace
mkdir -p /ws/src && cd /ws/src
git clone https://github.com/execbat/POLARIS_GEM_e2.git .
cd /ws
# dependencies
rosdep install --from-paths src --ignore-src -r -y- Build and run:
source /opt/ros/noetic/setup.bash
catkin_make
source devel/setup.bash
roslaunch gem_gazebo gem_gazebo_rviz.launch velodyne_points:=trueWe assume the Catkin workspace is under ~/gem_ws. Clone this repository to ~/gem_ws/src:
mkdir -p ~/gem_ws/src
cd ~/gem_ws/src
git clone https://github.com/execbat/POLARIS_GEM_e2.gitCompile the whole workspace with catkin_make:
source /opt/ros/noetic/setup.bash
cd ~/gem_ws
catkin_makeFor more on Catkin workspaces, see: http://wiki.ros.org/catkin/Tutorials/create_a_workspace.
source devel/setup.bash
roslaunch gem_gazebo gem_gazebo_rviz.launch velodyne_points:=truesource devel/setup.bash
roslaunch gem_gazebo gem_gazebo_rviz.launch
source devel/setup.bash
roslaunch gem_gazebo gem_sensor_info.launch
source devel/setup.bash
rosrun gem_pure_pursuit_sim pure_pursuit_sim.pysource devel/setup.bash
rosrun gem_stanley_sim stanley_sim.pysource devel/setup.bash
roslaunch gem_gazebo gem_gazebo_rviz.launch world_name:="highbay_track.world" x:=-5.5 y:=-21 velodyne_points:="true"
source devel/setup.bash
roslaunch gem_gazebo gem_sensor_info.launch-
Battery Failure
Profile: 100% → 51% over 30 s, then drops to 49%.
Expectation: ERROR at ≤ 50%. -
Temperature Spike
Profile: 30 °C → 55 °C over 30 s, then 60 °C.
Expectation: ERROR at ≥ 55 °C. -
GPS Fluctuation
Profile: initially high accuracy, then accuracy degrades to ≥ 200 mm for 20 s.
Expectation: ERROR if 200 mm for ≥ 15 s. -
Network Signal Fluctuation
Profile:1 (Connected)→2 (Low)for 10 s → back to1→ then0 (Not Connected)for 20 s.
Expectation: ERROR on sustained Not Connected; warning on Low. -
Emergency Stop
Profile:/gem/safety/stop == true.
Expectation: Immediate ERROR; Planner must be inhibited. -
Integration: StateManager × Planner
Verify that navigation tasks are sent only under safe conditions. Under any ERROR, Planner must not publish movement tasks; when back to OK, Planner resumes.
A prototype node vision_lka.py tracks the left yellow boundary using HSV∩LAB color masking, vertical scans, and a quadratic fit for heading/curvature. It publishes smooth Ackermann commands and slows down in tight curves.
Run the LKA node (inside the container):
source /opt/ros/noetic/setup.bash
source /ws/devel/setup.bash
rosrun gem_lane_keeping vision_lka.py _steer_sign:=-1.0 \
image:=/gem/front_single_camera/image_raw \
cmd:=/gem/ackermann_cmdQuick tuning at runtime:
# if steering is reversed:
rosparam set /vision_lka/steer_sign 1.0
# stronger response to lateral error / heading:
rosparam set /vision_lka/kp 0.10
rosparam set /vision_lka/k_heading 0.30Topics:
- Publishes:
/gem/ackermann_cmd(ackermann_msgs/AckermannDrive) - Diagnostics:
/vision_lka/lateral_error(std_msgs/Float32),/vision_lka/debug(sensor_msgs/Image) - Subscribes:
/gem/front_single_camera/image_raw(sensor_msgs/Image)
Note: LKA is experimental in this submission (baseline working, tuning ongoing).
gem_gazebo: Gazebo worlds, vehicle model, launch files.gem_supervisor/state_manager: monitors safety signals and drives ERROR states.planner: publishes navigation tasks when safe (integration-tested with StateManager).gem_lane_keeping: experimental vision-based LKA.
- The latest Velodyne LiDAR sensor package for Gazebo on Ubuntu 20.04 (
velodyne_simulator) may publish ROS messages with an incorrectframe_id(prefixed by the node’s namespace). TF/TF2 deprecatedtf_prefix, which can break RViz visualization. See http://wiki.ros.org/tf2/Migration.
- Hang Cui [email protected]
- Jiaming Zhang [email protected]
- Fork additions: lane-keeping prototype and system tests packaging.






