Local Automation (CI/CD) Tutorial#
Table of Contents
Overview top#
This documentation describes a tutorial for users to get started with local automation (continuous integration) for SVL Simulator with step-by-step instructions to follow.
The example simulations refered in this tutorial use the ROS 2 Navigation stack (Nav2) to navigate and control a robot autonomously. For a guide to setting up and using the simulator alongside Nav2, please see the Robot simulation with ROS 2 Navigation Stack guide.
Prerequisites top#
- SVL Simulator release 2021.3 or later
- Linux operating system (preferably Ubuntu 20.04 or later)
- Local Automation tool
- ROS 2 Navigation stack (Nav2)
Example Simulations top#
- Local-Test: Robot Freemode (Nav2)
- Local-Test: Robot Cut-in Scenario (Nav2)
- Local-Test: Robot Sudden Braking (Nav2)
- Local-Test: Robot Traffic Cones (Nav2)
Getting Started top#
-
Launch SVL Simulator
-
Make sure the above example simulations are configured correctly:
-
Click on the Open Browser button to launch the simulator Web UI in a web browser
-
In the Simulations section, locate the Local-Test: Robot Freemode (Nav2) simulation under the Available from Others tab and add it by clicking the Add button
-
Select your cluster from the dropdown menu in the General tab
-
Select the LGSeocho map in the Test case tab
-
Select the LGCloi vehicle with the Navigation2 sensor configuration in the Test case tab
-
Select the Other ROS 2 Autopilot with your bridge connection address (e.g., localhost:9090) in the Autopilot tab
-
Click on the Publish button to finish the simulation setup in the Publish tab
-
Repeat the above steps for the remaining simulations below:
- Local-Test: Robot Cut-in Scenario (Nav2)
- Local-Test: Robot Sudden Braking (Nav2)
- Local-Test: Robot Traffic Cones (Nav2)
-
Note down the UUID of example simulation
-
-
Set up the Local Automation tool following the Local Automation mode) guide
-
Bring up Nav2 stack locally following the Robot simulation with ROS 2 Navigation Stack guide
-
Create a new file
run.sh
on the same directory where the wrapper script is downloaded -
Paste the below script with your
ACCESS-TOKEN
and a desiredPATH-TO-LOGFILE
:
# Note that this script has been written for Bash
export SVLSIM__ACCESS_TOKEN="<ACCESS-TOKEN>"
LOGFILE="<PATH-TO-LOGFILE>"
# UUIDs for example simulations
declare -r SIMULATIONS="
6ac9ff51-ef76-46cf-836f-94ced3705937
0996920f-3be3-4c19-a529-0b08ac1ab679
5922903a-b766-4ebd-8cd3-c96a255d64a9
015be758-8f59-480f-be31-c8d79b1becd8
"
# Initialize a CLI session
if result=$(sh svlsim.sh cli initialize 2> ${LOGFILE}); then
: SUCCESS
else
echo "ABORT. Failed to initialize a CLI session: ${result}"
exit 1
fi
# Start simulations
for simulation_id in ${SIMULATIONS}; do
if result=$(sh svlsim.sh simulation start ${simulation_id} 2>> ${LOGFILE}); then
echo "[${simulation_id}] Starting..."
else
echo "[${simulation_id}] ERROR: ${result}"
continue
fi
while true; do
sleep 2
if status=$(sh svlsim.sh simulation check ${simulation_id} 2>> ${LOGFILE}); then
if [ ${status} != "progressing" ]; then
echo "[${simulation_id}] Done: ${status}"
break
fi
else
echo "[${simulation_id}] Abort: ${status}"
break
fi
done
done
-
Finally, run the script in a terminal:
$ bash run.sh
-
On the main window of the simulator, the example simulations should now run one after the other along with Nav2 stack without the need for clicking inside a UI.