This repository provides an open-source reference implementation of a real-time trajectory planning module for autonomous vehicles. The system separates the main planning module and simulation environment and runs on dedicated embedded hardware using a real-time operating system (RTOS). It includes three primary components:
- Frenetix-Motion-Planner: Runs on a Linux PC (preferably x86, since using ARM computers leads to the user having to build some dependencies manually)
- actuation_packages & build.sh: Runs on a Linux PC and acts as a communication bridge between the simulation environment and the embedded hardware.
- rt_motion_planning: Runs on an embedded platform and performs trajectory planning real time.
📦 Physical Setup
The image below shows the physical setup required to work with either the ARM Development Platform or the NXP Platform.
Connect the embedded board (NXP Evaluation Board or ARM Cortex-R Automotive Development System) as follows:
- Power via the standard power connector
- Debugging interface via JTAG to the PC (via S32 debug probe or Lauterbach probe)
- Ethernet cable to the same network as the PC
- Serial connection to view console output (e.g., via USB-UART)
💡 Use
/dev/ttyUSB*on Linux orCOM*on Windows and configure your serial tool (e.g. PuTTY or minicom) to 115200 baud.
💡 Note: When working with the ARM system, make sure you use the correct ethernet port.
⚙️ Zephyr RTOS Setup (rt_motion_planning)
-
Build and Run the Docker Container
Open the terminal and run:
docker build -t zephyr_sdk-autoware . docker run -it --rm --net=host zephyr_sdk-autoware /bin/bash -
Build the Application
Inside the container, run:
west build -b s32z270dc2_rtu0_r52@D rt_motion_planning
✅ For ARM board: add
-DEXTRA_DTC_OVERLAY_FILE=arm_ethernet.overlayto enable Ethernet. -
Flash the Board
west debug --s32ds-path=/usr/local/NXP/S32DS.3.6.3 --elf-file ~/actuation-demo/build/zephyr/zephyr.elf --tool-opt='--batch'
⚙️ Communication Bridge Setup (actuation_packages & build.sh)
-
Build and Run the Docker Container
In case you have not built and run the container yet, open the terminal and run:
docker build -t zephyr_sdk-autoware . docker run -it --rm --net=host zephyr_sdk-autoware /bin/bash -
Build the Application
Inside the container, run:
- For Linux host PC:
./build.sh
- For Windows host PC:
apt-get update && apt-get install -y dos2unix dos2unix build.sh ./build.sh -
Run the Application
Run tmux. Then open two windows.
On both windows, run:
source install/setup.bash export ROS_DOMAIN_ID=1 export CYCLONEDDS_URI=$(pwd)/cyclonedds.xml
On the 1st window, run:
ros2 launch actuation_message_converter actuation_message_converter.launch.py
On the 2nd window, run:
ros2 launch rosbridge_server rosbridge_websocket_launch.xml
⚙️ Simulation Environment Setup (Frenetix-Motion-Planner)
-
Follow the installation guide from the README inside the
Frenetix-Motion-Plannerfolder. -
Additionally, install roslibpy.
-
Run
python3 main.pyinsideFrenetix-Motion-Planner.
