Skip to content

ROS Helper Nodes for visualizing and utilizing LGSVL Simulator

License

Notifications You must be signed in to change notification settings

SS47816/lgsvl_utils

Repository files navigation

lgsvl-utils

ROS Helper Nodes for utilising LGSVL Simulator in Autonomous Vehicles Development

Ubuntu ROS C++ CodeFactor GitHub Repo stars GitHub Repo forks

cover_image

Updates

  • [19 Oct 2022] Major refactor of the repo, included minimal required autoware_ai components so now you can use this repo out-of-the box.

Features

  • Ground Truth Objects: Convert lgsvl 3D ground truth objects to autoware and jsk_recognition messages and visualize them in Rviz
  • Vehicle Status Publishing: The ego vehicle's Can Bus data are extracted from the lgsvl simulator and published to ROS
  • Map Format Supports: Support pointcloud map, lanelet2 map, vector map formats
  • Global Planning: Provide Global Planning in lanelet2 map format (Issue discovered, fixing...)
  • Joystick Control: Drive in the Simulator with a joystick (currently support Xbox, Logitech F710 joysticks, and control settings like Forza Horizon, Japan Hand, USA Hand)
  • Vehicle State Control: Control the Ego Vehicle's State with lgsvl_msgs::VehicleStateData message (including control of all the lights, blinkers, wipers, etc)
  • Vehicle Motion Control: Control the Ego Vehicle's Motion with lgsvl_msgs::VehicleControlData message (with Reversing Enabled)
  • Vehicle Model: Display the ego vehicle model in Rviz

TODOs

  • feat: 2D Ground Truth Objects
  • feat: Support for Other Sensors
  • feat: Relocalization?

Known Issues

  • The official BorregasAve lanelet2 map file contains minor connection errors (not going to fix)

Dependencies

  • System Requirements:
    • Ubuntu 18.04/20.04
    • ROS Melodic/Noetic
    • C++11 above
    • CMake: 3.0.2 above
  • This package is self-contained, only dependens on standard ROS pkgs:
    • jsk_recognition_msgs
    • autoware_msgs
    • lgsvl_msgs
    • visualization_msgs
    • geometry_msgs
    • sensor_msgs
    • nav_msgs
    • std_msgs
    • roscpp
    • rospy
    • tf2_ros
    • tf2_eigen
    • tf2_geometry_msgs
    • tf
    • joy
    • cv_bridge
    • image_transport
    • rosbridge_server

Installation

To use this package, you will need to create a catkin_ws first. Details please see the ROS official tutorial.

# clone the repo into your catkin workspace (assuming ~/catkin_ws here)
cd ~/catkin_ws/src
git clone https://github.com/SS47816/lgsvl_utils.git
cd ..

# install dependencies
rosdep install --from-paths src --ignore-src -r -y

# build
catkin_make
# source
source devel/setup.bash

Usage

Example BorregasAve Map in LGSVL

Step 1: Download LGSVL Simulator and register an account from here

Step 2: Download the LGSVL maps from the official repo

# create a directory called `shared_dir` under HOME directory
cd
mkdir shared_dir
cd ~/shared_dir
# clone the autoware map data into this directory
git clone https://github.com/lgsvl/autoware-data.git

Replace all the contents in ~/shared_dir/autoware-data/BorregasAve/ with the contents in lgsvl_utils/lgsvl_utils/lgsvl_assets/BorregasAve/

Step 3: Create a new simulation on the LGSVL simulator web client.

  1. On the General page, fill in some information and select your local cluster.
  2. On the Test Case page, select the BorregasAve Map, UT Lexus Vehicle and upload the sensor configuration provided in lgsvl_utils/lgsvl_assets/sensor_config/[Custom] Autoware AI.json
  3. On the Autopilot page, select Autoware.AI v1.14 and use the default localhost:9090

Step 4: Start the simulation

Step 5: Launch the nodes in this lgsvl_utils pkg using the lgsvl_utils/launch/lgsvl_borregas.launch

# launch the all the nodes on the example BorregasAve Map
roslaunch lgsvl_utils borregas.launch

demo_image

Step 6: You may now use a Xbox or Logitech F710 joystick to control the ego vehicle. You may change the joystick settings in launch/common.launch (joy_type and control_setting) or customize the button mapping accroding to your own preference in src/joystick_node.cpp.

Step 7: The mode of the ego vehicle is fully controlled by the joystick, for example: A -> Autonomous Mode, B -> Brake Mode, X -> Manual Mode, Y -> Manual Reverse Mode (Note: For safety considerations, the Autonomous Mode (A) can only be started when the vehicle is in Brake Mode (B).)

Contribution

You are welcome contributing to the package by opening a pull-request

We are following: Google C++ Style Guide, C++ Core Guidelines, and ROS C++ Style Guide

License

The lgsvl_utils is released under the MIT License

The included autoware_ai components follow their own Apache License 2.0