Table of Contents
This repo holds an IPG CarMaker Formula Student project with the ROS extension, enabling communication between both frameworks.
Having an IPG simulation platform with a ROS environment enable us to try different parts of the Autonomous Systems pipeline (mostly Autonomous Control) with a fine tunned Multibody Vehicle Model. Thus, a better correlation between simulation and testing results can be achieved, which traduces to an enhanced performance in the real track. Moreover, with IPG a full pipeline simulation is possible, meaning you can run the simulation for EV control algorithms (low level), Autonomous Control (high level) and Perception algorithms (high level).
From experience we know the best way to try (and fine-tune) our perception stack is by using real testing data. For this reason, this simulation includes a fake perception module (more info here) so we can simulate our AS Control together with our Low Level Control pipelines keeping the simulation light (without Raw LiDAR pointcloud generation, usually GPU-demanding).
With this project, our team has been able to simulate for the first time our complete Vehicle Controls software stack, which involves:
- AS Control:
- Lateral NMPC
- Adaptive Cruise Control
- Tracklimits
- Path Planning
- Low Level Control (shared with manual):
- Regenerative Braking
- Torque Vectoring
- Traction Control
- Power Control
If you use this simulation pkgs the only thing I ask for is to ALWAYS REFERENCE the team BCN eMotorsport.
For obvious reasons, the vehicle model parametrization of our prototype is not included in this repo. The default IPG's FS vehicle model is given. You should specify your own car specs for a precise simulation.
- Ubuntu 20.04
- ROS Noetic
- Eigen3
- IPG CarMaker 11.0.1 license
- Catkin Tools (optional)
NOTE: I strongly recommend installing catkin_tools for building this project. If not, you must edit the build.sh bash script in order to build the project with the ROS default catkin_make command.
- Manually re-create the libcmcppifloader symbolic link to the latest version of the CMRosIF library, which is currently
libcmcppifloader-linux64.so.1.0.0
:
cd lib/
sudo ln -sfn libcmcppifloader-linux64.so.1.0.0 libcmcppifloader-linux64.so
- Check added paths during the IPG default installation. You should have this commands written down in your '.bashrc' file (if not copy and paste them at the end of the file):
# Additional paths for IPG CM
addpath ()
{ for d in "$@"; do PATH="$PATH:$d"; done; }
addpath /opt/ipg/hil/linux/bin /opt/ipg/hil/linux/GUI /opt/ipg/hil/linux/GUI64
addpath /opt/ipg/bin /opt/ipg/carmaker/linux64/bin /opt/ipg/carmaker/linux64/GUI
- Build the CarMaker Project and ROS workspace:
cd /path_to/FSDriverless # go to the repo dir
chmod +x ./build.sh # only once
./build.sh
- Finally, run a CarMaker instance (now with CMRosIF extension):
./CMStart.sh
The loaded TestRun should be FS_autonomous_Trackdrive. This TestRun will run the car on an infinite track in order to use IPG only as the physics engine of the simulation (at the lowest layer).
For more information about the simulation workflow READ THIS.
If ./build.sh
command failed, you should open the Car Maker GUI in order to update the project:
cd /path_to/FSDriverless # go to the repo dir
./CMStart.sh
# NOTE: usually some processes will die or fail after openning the GUI at this point. It's ok, we only want to update our CM Project
Once there, go to File
> Project Folder
> Update Project..
and select the option Sources / Build Environment
. This command will update the necessary files inside this repo in order to build the CM Project with your computer specs.
After updating the project, User.c and Makefile will have been overwritten, so IPG won't know this repo holds the CMRosIF extension. To fix this, substitude these files with the User.c and Makefile files found inside the src_cmrosif directory.
Within this project we can find two ROS workspaces, one for ROS1 and another for ROS2. The CMRosIf is compatible with both, so it is possible to keep simulating with IPG once your pipeline works with ROS2. However, keep in mind that this whole project has been created in order to work with ROS1 (Noetic), so it is possible that some build flags and/or IPG parameters will have to be changed in order to be compatible with ROS2.