diff --git a/assets/contributors.csv b/assets/contributors.csv index 1bd3df8895..8de0eb0454 100644 --- a/assets/contributors.csv +++ b/assets/contributors.csv @@ -82,7 +82,7 @@ Odin Shen,Arm,odincodeshen,odin-shen-lmshen,, Avin Zarlez,Arm,AvinZarlez,avinzarlez,,https://www.avinzarlez.com/ Shuheng Deng,Arm,,,, Yiyang Fan,Arm,,,, -Julien Jayat,Arm,,,, +Julien Jayat,Arm,JulienJayat-Arm,julien-jayat-a980a397,, Geremy Cohen,Arm,geremyCohen,geremyinanutshell,, Barbara Corriero,Arm,,,, Nina Drozd,Arm,NinaARM,ninadrozd,, diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/1_functional_safety.md b/content/learning-paths/automotive/openadkit2_safetyisolation/1_functional_safety.md new file mode 100644 index 0000000000..026b729ba8 --- /dev/null +++ b/content/learning-paths/automotive/openadkit2_safetyisolation/1_functional_safety.md @@ -0,0 +1,143 @@ +--- +title: Functional Safety for automotive software development +weight: 2 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Why Functional Safety Matters in Automotive Software + +[Functional Safety](https://en.wikipedia.org/wiki/Functional_safety) refers to a system's ability to detect potential faults and respond appropriately to ensure that the system remains in a safe state, preventing harm to individuals or damage to equipment. + +This is particularly important in **automotive, autonomous driving, medical devices, industrial control, robotics and aerospace** applications, where system failures can lead to severe consequences. + +In software development, Functional Safety focuses on minimizing risks through **software design, testing, and validation** to ensure that critical systems operate in a predictable, reliable, and verifiable manner. This means developers must consider: +- **Error detection mechanisms** +- **Exception handling** +- **Redundancy design** +- **Development processes compliant with safety standards** + +### Definition and Importance of Functional Safety + +The core of Functional Safety lies in **risk management**, which aims to reduce the impact of system failures. + +In autonomous vehicles, Functional Safety ensures that if sensor data is incorrect, the system can enter a **safe state**, preventing incorrect driving decisions. + +The three core objectives of Functional Safety are: +1. **Prevention** + - Reducing the likelihood of errors through rigorous software development processes and testing. In the electric vehicle, the battery systems monitor temperature to prevent overheating. +2. **Detection** + - Quickly identifying errors using built-in diagnostic mechanisms (e.g., Built-in Self-Test, BIST). +3. **Mitigation** + - Controlling the impact of failures to ensure the overall safety of the system. + +This approach is critical in applications such as **autonomous driving, flight control, and medical implants**, where failures can result in **severe consequences**. + +### ISO 26262: Automotive Functional Safety Standard + +[ISO 26262](https://www.iso.org/standard/68383.html) is a functional safety standard specifically for **automotive electronics and software systems**. It defines a comprehensive [V-model](https://en.wikipedia.org/wiki/V-model) aligned safety lifecycle, covering all phases from **requirement analysis, design, development, testing, to maintenance**. + +Key Concepts of ISO 26262: +- **ASIL (Automotive Safety Integrity Level)** + - Evaluates the risk level of different system components (A, B, C, D, where **D represents the highest safety requirement**). + - For example: ASIL A can be Dashboard light failure (low risk) and ASIL D is Brake system failure (high risk). + https://en.wikipedia.org/wiki/Automotive_Safety_Integrity_Level +- **HARA (Hazard Analysis and Risk Assessment)** + - Analyzes hazards and assesses risks to determine necessary safety measures. +- **Safety Mechanisms** + - Includes real-time error detection, system-level fault tolerance, and defined fail-safe or fail-operational fallback states. + +Typical Application Scenarios: +- **Autonomous Driving Systems**: + - Ensures that even if sensors (e.g., LiDAR, radar, cameras) provide faulty data, the vehicle will not make dangerous decisions. +- **Powertrain Control**: + - Prevents braking system failures that could lead to loss of control. +- **Battery Management System (BMS)**: + - Prevents battery overheating or excessive discharge in electric vehicles. + +For more details, you can check this video: [What is Functional Safety?](https://www.youtube.com/watch?v=R0CPzfYHdpQ) + + +### Common Use Cases of Functional Safety in Automotive +- **Autonomous Driving**: + - Ensures the vehicle can operate safely or enter a fail-safe state when sensors like LiDAR, radar, or cameras malfunction. + - Functional Safety enables real-time fault detection and fallback logic to prevent unsafe driving decisions. + +- **Powertrain Control**: + - Monitors throttle and brake signals to prevent unintended acceleration or braking loss. + - Includes redundancy, plausibility checks, and emergency overrides to maintain control under failure conditions. + +- **Battery Management Systems (BMS)**: + - Protects EV batteries from overheating, overcharging, or deep discharge. + - Safety functions include temperature monitoring, voltage balancing, and relay cut-off mechanisms to prevent thermal runaway. + +These use cases highlight the need for a dedicated architectural layer that can enforce Functional Safety principles with real-time guarantees. +A widely adopted approach in modern automotive platforms is the Safety Island—an isolated compute domain designed to execute critical control logic independently of the main system. + +### Safety Island: Enabling Functional Safety in Autonomous Systems + +In automotive systems, a **General ECU (Electronic Control Unit)** typically runs non-critical tasks such as infotainment or navigation, whereas a **Safety Island** is dedicated to executing safety-critical control logic (e.g., braking, steering) with strong isolation, redundancy, and determinism. + +The table below compares the characteristics of a General ECU and a Safety Island in terms of their role in supporting Functional Safety. + +| Feature | General ECU | Safety Island | +|------------------------|----------------------------|--------------------------------------| +| Purpose | Comfort / non-safety logic | Safety-critical decision making | +| OS/Runtime | Linux, Android | RTOS, Hypervisor, or bare-metal | +| Isolation | Soft partitioning | Hard isolation (hardware-enforced) | +| Functional Safety Req | None to moderate | ISO 26262 ASIL-B to ASIL-D compliant | +| Fault Handling | Best-effort recovery | Deterministic safe-state response | + +This contrast highlights why safety-focused software needs a dedicated hardware domain with certified execution behavior. + +**Safety Island** is an independent safety subsystem separate from the main processor. It is responsible for monitoring and managing system safety. If the main processor fails or becomes inoperable, Safety Island can take over critical safety functions such as **deceleration, stopping, and fault handling** to prevent catastrophic system failures. + +Key Capabilities of Safety Island +- **System Health Monitoring** + - Continuously monitors the operational status of the main processor (e.g., ADAS control unit, ECU) and detects potential errors or anomalies. +- **Fault Detection and Isolation** + - Independently evaluates and initiates emergency handling if the main processing unit encounters errors, overheating, computational failures, or unresponsiveness. +- **Providing Essential Safety Functions** + - Even if the main system crashes, Safety Island can still execute minimal safety operations, such as: + - Autonomous Vehicles → Safe stopping (Fail-Safe Mode) + - Industrial Equipment → Emergency power cutoff or speed reduction + + +### Why Safety Island Matters for Functional Safety + +Safety Island plays a critical role in Functional Safety by ensuring that the system can handle high-risk scenarios and minimize catastrophic failures. + +How Safety Island Enhances Functional Safety +1. **Acts as an Independent Redundant Safety Layer** + - Even if the main system fails, it can still operate independently. +2. **Supports ASIL-D Safety Level** + - Monitors ECU health status and executes emergency safety strategies (e.g., emergency braking). +3. **Provides Independent Fault Detection and Recovery Mechanisms** + - **Fail-Safe**: Activates a **safe mode**, such as limiting vehicle speed or switching to manual control. + - **Fail-Operational**: Ensures that high-safety applications (e.g., aerospace systems) can continue operating under certain conditions. + +For more insights on **Arm's Functional Safety solutions**, you can refer to: [Arm Functional Safety Compute Blog](https://community.arm.com/arm-community-blogs/b/automotive-blog/posts/functional-safety-compute) + + +### Functional Safety in the Software Development Lifecycle + +Functional Safety impacts **both hardware and software development**, particularly in areas such as requirement changes, version management, and testing validation. +For example, in ASIL-D level applications, every code modification requires a complete impact analysis and regression testing to ensure that new changes do not introduce additional risks. + +### Functional Safety Requirements in Software Development +These practices ensure the software development process meets industry safety standards and can withstand system-level failures: +- **Requirement Specification** + - Clearly defining **safety-critical requirements** and conducting risk assessments. +- **Safety-Oriented Programming** + - Following **MISRA C, CERT C/C++ standards** and using static analysis tools to detect errors. +- **Fault Handling Mechanisms** + - Implementing **redundancy design and health monitoring** to handle anomalies. +- **Testing and Verification** + - Using **Hardware-in-the-Loop (HIL)** testing to ensure software safety in real hardware environments. +- **Version Management and Change Control** + - Using **Git, JIRA, Polarion** to track changes for safety audits. + +This learning path builds upon the previous containerized [learning path](https://learn.arm.com/learning-paths/automotive/openadkit1_container) guide and introduces Functional Safety design practices from the earliest development stages. + +By establishing an ASIL Partitioning software development environment and leveraging [**SOAFEE**](https://www.soafee.io/) technologies, developers can enhance software consistency and maintainability in Functional Safety applications. diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/2_data_distribution_service.md b/content/learning-paths/automotive/openadkit2_safetyisolation/2_data_distribution_service.md new file mode 100644 index 0000000000..64aab3cab5 --- /dev/null +++ b/content/learning-paths/automotive/openadkit2_safetyisolation/2_data_distribution_service.md @@ -0,0 +1,89 @@ +--- +title: How to Use Data Distribution Service (DDS) +weight: 3 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +### Introduction to DDS +Data Distribution Service (DDS) is a real-time, high-performance middleware designed for distributed systems. +It is particularly valuable in automotive software development, including applications such as **autonomous driving (AD)** and **advanced driver assistance systems (ADAS)**. + +DDS offers a decentralized architecture that enables scalable, low-latency, and reliable data exchange—making it ideal for managing high-frequency sensor streams. + +In modern vehicles, multiple sensors (LiDAR, radar, cameras) must continuously communicate with compute modules. + +DDS ensures these components share data seamlessly and in real time, both within the vehicle and across infrastructure (e.g., V2X systems like traffic lights and road sensors). + + +### Why Automotive Software Needs DDS + +Next-generation automotive software architectures —like [SOAFEE](https://www.soafee.io/)- depend on deterministic, distributed communication. Traditional client-server models introduce latency and single points of failure, while DDS’s publish-subscribe model enables direct, peer-to-peer communication across system components. + +For example, a LiDAR sensor broadcasting obstacle data can simultaneously deliver updates to perception, SLAM, and motion planning modules—without redundant network traffic or central coordination. + +Additionally, DDS provides a flexible Quality of Service (QoS) configuration, allowing engineers to fine-tune communication parameters based on system requirements. Low-latency modes are ideal for real-time decision-making in vehicle control, while high-reliability configurations ensure data integrity in safety-critical applications like V2X communication. + +These capabilities make DDS an essential backbone for autonomous vehicle stacks, where real-time sensor fusion and control coordination are critical for safety and performance. + +### DDS Architecture and Operation + +DDS uses a **data-centric publish-subscribe (DCPS)** model, allowing producers and consumers of data to communicate without direct dependencies. This modular approach enhances system flexibility and maintainability, making it well-suited for complex automotive environments. + +DDS organizes communication within **domains**, which act as isolated scopes. Inside each domain: +- ***Topics*** represent named data streams (e.g., /vehicle/speed, /perception/objects) +- ***DataWriters*** (publishers) send data to topics +- ***DataReaders*** (subscribers) receive data from topics +This structure enables concurrent, decoupled communication between multiple modules without hardcoding communication links. + +Each domain contains multiple **topics**, representing specific data types such as vehicle speed, obstacle detection, or sensor fusion results. **Publishers** use **DataWriters** to send data to these topics, while **subscribers** use **DataReaders** to receive the data. This architecture supports concurrent data processing, ensuring that multiple modules can work with the same data stream simultaneously. + +For example, in an autonomous vehicle, LiDAR, radar, and cameras continuously generate large amounts of sensor data. The perception module subscribes to these sensor topics, processes the data, and then publishes detected objects and road conditions to other components like path planning and motion control. Since DDS automatically handles participant discovery and message distribution, engineers do not need to manually configure communication paths, reducing development complexity. + + +### Real-World Use in Autonomous Driving +DDS is widely used in autonomous driving systems, where real-time data exchange is crucial. A typical use case involves high-frequency sensor data transmission and decision-making coordination between vehicle subsystems. + +For instance, a LiDAR sensor generates millions of data points per second, which need to be shared with multiple modules. DDS allows this data to be published once and received by multiple subscribers, including perception, localization, and mapping components. After processing, the detected objects and road features are forwarded to the path planning module, which calculates the vehicle's next movement. Finally, control commands are sent to the vehicle actuators, ensuring precise execution. + +This real-time data flow must occur within milliseconds to enable safe autonomous driving. DDS ensures minimal transmission delay, enabling rapid response to dynamic road conditions. In emergency scenarios, such as detecting a pedestrian or sudden braking by a nearby vehicle, DDS facilitates instant data propagation, allowing the system to take immediate corrective action. + +For example: [Autoware](https://www.autoware.org/)—an open-source autonomous driving software stack—uses DDS to handle high-throughput communication across its modules. + +The **Perception** stack publishes detected objects from LiDAR and camera sensors to a shared topic, which is then consumed by the **Planning** module in real-time. Using DDS allows each subsystem to scale independently while preserving low-latency and deterministic communication. + +### Publish-Subscribe Model and Data Transmission +Let’s explore how DDS’s publish-subscribe model fundamentally differs from traditional communication methods in terms of scalability, latency, and reliability. + +Traditional client-server communication requires a centralized server to manage data exchange. This architecture introduces several drawbacks, including increased latency and network congestion, which can be problematic in real-time automotive applications. + +DDS adopts a publish-subscribe model, enabling direct communication between system components. Instead of relying on a central entity to relay messages, DDS allows each participant to subscribe to relevant topics and receive updates as soon as new data becomes available. This approach reduces dependency on centralized infrastructure and improves overall system performance. + +For example, in an automotive perception system, LiDAR, radar, and cameras continuously publish sensor data. Multiple subscribers, including object detection, lane recognition, and obstacle avoidance modules, can access this data simultaneously without additional network overhead. DDS automatically manages message distribution, ensuring efficient resource utilization. + +DDS supports multiple transport mechanisms to optimize communication efficiency: +- **Shared memory transport**: Ideal for ultra-low-latency communication within an ECU, minimizing processing overhead. +- **UDP or TCP/IP**: Used for inter-device communication, such as V2X applications where vehicles exchange safety-critical messages. +- **Automatic participant discovery**: Eliminates the need for manual configuration, allowing DDS nodes to detect and establish connections dynamically. + +#### Comparison of DDS and Traditional Communication Methods + +The following table highlights how DDS improves upon traditional client-server communication patterns in the context of real-time automotive applications: + +| **Feature** | **Traditional Client-Server Architecture** | **DDS Publish-Subscribe Model** | +|-----------------------|--------------------------------------------|--------------------------- | +| **Data Transmission** | Relies on a central server | Direct peer-to-peer communication | +| **Latency** | Higher latency | Low latency | +| **Scalability** | Limited by server capacity | Suitable for large-scale systems | +| **Reliability** | Server failure affects the whole system | No single point of failure | +| **Use Cases** | Small-scale applications | V2X, autonomous driving | + +These features make DDS a highly adaptable solution for automotive software engineers seeking to develop scalable, real-time communication frameworks. + +In this section, you learned how DDS enables low-latency, scalable, and fault-tolerant communication for autonomous vehicle systems. + +Its data-centric publish-subscribe architecture eliminates the limitations of traditional client-server models and forms the backbone of modern automotive software frameworks such as ROS 2 and SOAFEE. + +To get started with open-source DDS on Arm platforms, refer to this [installation guide for Cyclonedds](https://learn.arm.com/install-guides/cyclonedds) on how to install open-source DDS on an Arm platform. + diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/3_container_spliting.md b/content/learning-paths/automotive/openadkit2_safetyisolation/3_container_spliting.md new file mode 100644 index 0000000000..f4d07f14ab --- /dev/null +++ b/content/learning-paths/automotive/openadkit2_safetyisolation/3_container_spliting.md @@ -0,0 +1,372 @@ +--- +title: Split into multiple cloud container instances +weight: 4 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +### System Architecture and Component Design + +Now that you’ve explored the concept of a Safety Island -- a dedicated subsystem responsible for executing safety-critical control logic—and learned how DDS (Data Distribution Service) enables real-time, distributed communication, you’ll refactor the original OpenAD Kit architecture into a multi-instance deployment. + +In the [previous learning path](http://learn.arm.com/learning-paths/automotive/openadkit1_container/), OpenAD Kit deployed three container components on a single Arm-based instance, handling: +- ***Simulation environment*** +- ***Visualization*** +- ***Planning-Control*** + +In this session, you will split the simulation and visualization stack from the planning-control logic and deploy them across two independent Arm-based instances. + +These nodes communicate using ROS 2 with DDS as the middleware layer, ensuring low-latency and fault-tolerant data exchange between components. + +### Architectural Benefits +This architecture brings several practical benefits: + +- ***Enhanced System Stability:*** +Decoupling components prevents resource contention and ensures that safety-critical functions remain deterministic and responsive. + +- ***Real-Time, Scalable Communication:*** +DDS enables built-in peer discovery and configurable QoS, removing the need for a central broker or manual network setup. + +- ***Improved Scalability and Performance Tuning:*** +Each instance can be tuned based on its workload—e.g., simulation tasks can use GPU-heavy hardware, while planning logic may benefit from CPU-optimized setups. + +- ***Support for Modular CI/CD Workflows:*** +With containerized separation, you can build, test, and deploy each module independently—enabling agile development and faster iteration cycles. + +![img1 alt-text#center](aws_example.jpg "Figure 1: Split instance example in AWS") + + +### Networking Setting + +To begin, launch two Arm-based instances—either as cloud VMs (e.g., AWS EC2) or on-premise Arm servers. +These instances will independently host your simulation and control workloads. + +{{% notice Note %}} +The specifications of the two Arm instances don’t need to be identical. In my tests, 16 CPUs and 32GB of RAM have already provided good performance. +{{% /notice %}} + +After provisioning the machines, determine where you want the `Planning-Control` container to run. +The other instance will host the `Simulation Environment` and `Visualization` components. + +To enable ROS 2 and DDS communication between the two nodes, configure network access accordingly. +If you are using AWS EC2, both instances should be assigned to the same ***Security Group***. + +Within the EC2 Security Group settings: +- Add an Inbound Rule that allows all traffic from the same Security Group (i.e., set the source to the group itself). +- Outbound traffic is typically allowed by default and usually does not require changes. + +![img2 alt-text#center](security_group.jpg "Figure 2: AWS Security Group Setting") + +This configuration allows automatic discovery and peer-to-peer communication between DDS participants across the two instances. + +Once both systems are operational, record the private IP addresses of each instance. You will need them when configuring CycloneDDS peer discovery in the next step. + +### New Docker YAML Configuration Setting + +Before you begin, ensure that Docker is installed on both of your development instances. +You will also need to clone the demo repository used in the previous learning path. + +First, you need clone the demo repo and create xml file called `cycloneDDS.xml` + +#### Step 1: Clone the repository and prepare configuration files + +```bash +git clone https://github.com/odincodeshen/openadkit_demo.autoware.git + +cd openadkit_demo.autoware +cp docker/docker-compose.yml docker/docker-compose-2ins.yml +touch docker/cycloneDDS.xml +``` + +This will create a duplicate Compose configuration (docker-compose-2ins.yml) and an empty CycloneDDS configuration file to be shared across containers. + +To ensure a smooth experience during testing and simulation, it’s a good idea to pull all required container images before moving on. + +This avoids interruptions in later steps when you run `docker compose up` or `docker compose run`, especially during the cross-instance DDS validation or full scenario launch. + +Run the following command in your project directory: + +```bash +docker compose -f docker-compose.yml pull +``` + +{{% notice info %}} +Each image is around 4–6 GB, so pulling them may vary depending on your network speed. +{{% /notice %}} + +This command will download all images defined in the docker-compose-2ins.yml file, including: +- ***odinlmshen/autoware-simulator:v1.0*** +- ***odinlmshen/autoware-planning-control:v1.0*** +- ***odinlmshen/autoware-visualizer:v1.0*** + +#### Step 2: Configure CycloneDDS for Peer-to-Peer Communication + +The cycloneDDS.xml file is used to customize how CycloneDDS (the middleware used by ROS 2) discovers and communicates between distributed nodes. + +Please copy the following configuration into docker/cycloneDDS.xml on both machines, and replace the IP addresses with the private IPs of each EC2 instance (e.g., 192.168.xx.yy and 192.168.aa.bb): + +```xml + + + + false + + + + + + 1000 + auto + + + + + + + /root/workspace/cyclonelog.log + config + + + +``` + +{{% notice Note %}} +1. Make sure the network interface name (ens5) matches the one on your EC2 instances. You can verify this using ip -br a. +2. This configuration disables multicast and enables static peer discovery between the two machines using unicast. +3. You can find the more detail about CycloneDDS setting [Configuration](https://cyclonedds.io/docs/cyclonedds/latest/config/config_file_reference.html#cyclonedds-domain-internal-socketreceivebuffersize) +{{% /notice %}} + + +#### Step 3: Update the Docker Compose Configuration for Multi-Host Deployment + +To support running containers across two separate hosts, you’ll need to modify the docker/docker-compose-2ins.yml file. +This includes removing inter-container dependencies and updating the network and environment configuration. + +##### Remove Cross-Container Dependency + +Since the planning-control and simulator containers will now run on different machines, you must remove any depends_on references between them to prevent Docker from attempting to start them on the same host. + +```YAML + planning-control: + # Remove this block + # depends_on: + # - simulator +``` + +##### Enable Host Networking +All three containers (visualizer, simulator, planning-control) need access to the host’s network interfaces for DDS-based peer discovery. +Replace Docker’s default bridge network with host networking: + +```YAML + visualizer: + network_mode: host +``` + +##### Use CycloneDDS Configuration via Environment Variable + +To ensure that each container uses your custom DDS configuration, mount the current working directory and set the CYCLONEDDS_URI environment variable: + +```YAML + volumes: + - .:/root/workspace + environment: + - CYCLONEDDS_URI=/root/workspace/cycloneDDS.xml +``` + +Add this to every container definition to ensure consistent behavior across the deployment. + +Here is the complete XML file: +```YAML +services: + simulator: + image: odinlmshen/autoware-simulator:v1.0 + container_name: simulator + network_mode: host + volumes: + - ./etc/simulation:/autoware/scenario-sim + - .:/root/workspace + environment: + - ROS_DOMAIN_ID=88 + - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp + - CYCLONEDDS_URI=/root/workspace/cycloneDDS.xml + command: > + ros2 launch scenario_test_runner scenario_test_runner.launch.py + record:=false + scenario:=/autoware/scenario-sim/scenario/yield_maneuver_demo.yaml + sensor_model:=sample_sensor_kit + vehicle_model:=sample_vehicle + initialize_duration:=90 + global_timeout:=$TIMEOUT + global_frame_rate:=20 + launch_autoware:=false + launch_rviz:=false + + planning-control: + image: odinlmshen/autoware-planning-control:v1.0 + container_name: planning-control + network_mode: host + deploy: + volumes: + - ./etc/simulation:/autoware/scenario-sim + - $CONF_FILE:/opt/autoware/share/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/static_obstacle_avoidance.param.yaml + - $COMMON_FILE:/opt/autoware/share/autoware_launch/config/planning/scenario_planning/common/common.param.yaml + - .:/root/workspace + environment: + - ROS_DOMAIN_ID=88 + - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp + - CYCLONEDDS_URI=/root/workspace/cycloneDDS.xml + command: > + ros2 launch autoware_launch planning_simulator.launch.xml + map_path:=/autoware/scenario-sim/map + vehicle_model:=sample_vehicle + sensor_model:=sample_sensor_kit + scenario_simulation:=true + rviz:=false + perception/enable_traffic_light:=false + + visualizer: + image: odinlmshen/autoware-visualizer:v1.0 + network_mode: host + container_name: visualizer + volumes: + - ./etc/simulation:/autoware/scenario-sim + - .:/root/workspace + ports: + - 6080:6080 + - 5999:5999 + environment: + - ROS_DOMAIN_ID=88 + - VNC_ENABLED=true + - RVIZ_CONFIG=/autoware/scenario-sim/rviz/scenario_simulator.rviz + - NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN} + - NGROK_URL=${NGROK_URL} + - CYCLONEDDS_URI=/root/workspace/cycloneDDS.xml + command: >- + sleep infinity +``` + +Before moving to the next step, make sure that `docker-compose-2ins.yml` and `cycloneDDS.xml` are already present on both instances. + +#### Step 4: Optimize Network Settings for DDS Communication + +In a distributed DDS setup, `high-frequency UDP traffic` between nodes may lead to `IP packet fragmentation` or `buffer overflows`, especially under load. +These issues can degrade performance or cause unexpected system behavior. + + +```bash +sudo sysctl net.ipv4.ipfrag_time=3 +sudo sysctl net.ipv4.ipfrag_high_thresh=134217728 +sudo sysctl -w net.core.rmem_max=2147483647 +``` + +Explanation of Parameters +- ***net.ipv4.ipfrag_time=3***: Reduces the timeout for holding incomplete IP fragments, helping free up memory more quickly. +- ***net.ipv4.ipfrag_high_thresh=134217728***: Increases the memory threshold for IP fragment buffers to 128 MB, preventing early drops under high load. +- ***net.core.rmem_max=2147483647***: Expands the maximum socket receive buffer size to support high-throughput DDS traffic. + +To ensure these settings persist after reboot, create a configuration file under /etc/sysctl.d/: + +```bash +sudo bash -c 'cat > /etc/sysctl.d/10-cyclone-max.conf <}} + {{< tab header="Planning-Control" language="bash">}} + !/bin/bash + # Configure the environment variables + export SCRIPT_DIR=/home/ubuntu/openadkit_demo.autoware/docker + CONF_FILE_PASS=$SCRIPT_DIR/etc/simulation/config/pass_static_obstacle_avoidance.param.yaml + CONF_FILE_FAIL=$SCRIPT_DIR/etc/simulation/config/fail_static_obstacle_avoidance.param.yaml + + export CONF_FILE=$CONF_FILE_FAIL + export COMMON_FILE=$SCRIPT_DIR/etc/simulation/config/common.param.yaml + export NGROK_AUTHTOKEN=$NGROK_AUTHTOKEN + export NGROK_URL=$NGROK_URL + + # Start planning-control + echo "Running planning v1.." + TIMEOUT=120 CONF_FILE=$CONF_FILE_PASS docker compose -f "$SCRIPT_DIR/docker-compose-2ins.yml" up planning-control -d + {{< /tab >}} + + {{< tab header="Visualizer & Simulator" language="bash">}} + #!/bin/bash + SCRIPT_DIR=/home/ubuntu/openadkit_demo.autoware/docker + + export CONF_FILE_FAIL=$SCRIPT_DIR/etc/simulation/config/fail_static_obstacle_avoidance.param.yaml + export CONF_FILE=$CONF_FILE_FAIL + export COMMON_FILE=$SCRIPT_DIR/etc/simulation/config/common.param.yaml + export NGROK_AUTHTOKEN=$NGROK_AUTHTOKEN + export NGROK_URL=$NGROK_URL + export TIMEOUT=300 + + # Start visualizer once + docker compose -f "$SCRIPT_DIR/docker-compose-2ins.yml" up visualizer -d + echo "Waiting 10 seconds for visualizer to start..." + sleep 10 + + # Run simulator scenario 3 times + for i in {1..3}; do + echo "Running simulator demo round $i..." + docker compose -f "$SCRIPT_DIR/docker-compose-2ins.yml" run --rm simulator + echo "Round $i complete. Waiting 5 seconds before next run..." + sleep 5 + done + echo "All simulator runs complete." + {{< /tab >}} +{{< /tabpane >}} + +You can also find the prepared launch scripts—`opad_planning.sh` and `opad_sim_vis.sh` —inside the `openadkit_demo.autoware/docker` directory on both instances. + +These scripts encapsulate the required environment variables and container commands for each role. + +#### Running the Distributed OpenAD Kit Demo + +On the Planning-Control node, execute: + +```bash +./opad_planning.sh +``` + +On the Simulation and Visualization node, execute: + +```bash +./opad_sim_vis.sh +``` + +Once both machines are running their respective launch scripts, the Visualizer will generate a web-accessible interface using the machine’s public IP address. +You can open this link in a browser to observe the demo behavior, which will closely resemble the output from the [previous learning path](http://learn.arm.com/learning-paths/automotive/openadkit1_container/4_run_openadkit/). + +![img3 alt-text#center](split_aws_run.gif "Figure 4: Simulation") + +Unlike the previous setup, the containers are now distributed across two separate instances, enabling real-time, cross-node communication. +Behind the scenes, this architecture demonstrates how DDS manages low-latency, peer-to-peer data exchange in a distributed ROS 2 environment. + +To support demonstration and validation, the simulator is configured to run `three times` sequentially, giving you multiple opportunities to observe how data flows between nodes and verify that communication remains stable across each cycle. + +Now that you’ve seen the distributed system in action, consider exploring different QoS settings, network conditions, or even adding a third node to expand the architecture further. diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/_index.md b/content/learning-paths/automotive/openadkit2_safetyisolation/_index.md new file mode 100644 index 0000000000..aedf6f1c3d --- /dev/null +++ b/content/learning-paths/automotive/openadkit2_safetyisolation/_index.md @@ -0,0 +1,49 @@ +--- +title: Prototyping Safety-Critical Isolation for Autonomous Application on Neoverse + +minutes_to_complete: 60 + +who_is_this_for: This learning path targets advanced automotive software engineers developing safety-critical systems. It demonstrates how to use Arm Neoverse cloud infrastructure to accelerate ISO-26262-compliant software prototyping and testing workflows. + +learning_objectives: + - Learn the Functional Safety principles—including risk prevention, fault detection, and ASIL compliance—to design robust and certifiable automotive software systems. + - Understand how DDS enables low-latency, scalable, and fault-tolerant data communication for autonomous driving systems using a publish-subscribe architecture. + - Distributed Development for Functional Safety. Learn how to split the simulation platform into two independent units and leverage distributed development architecture to ensure functional safety. + +prerequisites: + - Two Arm-based Neoverse cloud instances or a local Arm Neoverse Linux computer with at least 16 CPUs and 32GB of RAM. + - Completion of the previous learning path. http://learn.arm.com/learning-paths/automotive/openadkit1_container/ + - Basic knowledge of Docker operations. +author: + - Odin Shen + - Julien Jayat + +### Tags +skilllevels: Advanced +subjects: Containers and Virtualization +armips: + - Neoverse +tools_software_languages: + - Python + - Docker + - ROS2 +operatingsystems: + - Linux + +further_reading: + - resource: + title: eclipse-zenoh github + link: https://learn.arm.com/learning-paths/automotive/openadkit1_container/ + type: documentation + - resource: + title: Eclipse Cyclone DDS + link: https://github.com/eclipse-cyclonedds/cyclonedds + type: documentation + + +### FIXED, DO NOT MODIFY +# ================================================================================ +weight: 1 # _index.md always has weight of 1 to order correctly +layout: "learningpathall" # All files under learning paths have this same wrapper +learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content. +--- diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/_next-steps.md b/content/learning-paths/automotive/openadkit2_safetyisolation/_next-steps.md new file mode 100644 index 0000000000..c3db0de5a2 --- /dev/null +++ b/content/learning-paths/automotive/openadkit2_safetyisolation/_next-steps.md @@ -0,0 +1,8 @@ +--- +# ================================================================================ +# FIXED, DO NOT MODIFY THIS FILE +# ================================================================================ +weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation. +title: "Next Steps" # Always the same, html page title. +layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing. +--- diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/aws_example.jpg b/content/learning-paths/automotive/openadkit2_safetyisolation/aws_example.jpg new file mode 100644 index 0000000000..c255da513f Binary files /dev/null and b/content/learning-paths/automotive/openadkit2_safetyisolation/aws_example.jpg differ diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/security_group.jpg b/content/learning-paths/automotive/openadkit2_safetyisolation/security_group.jpg new file mode 100644 index 0000000000..6dcf545c48 Binary files /dev/null and b/content/learning-paths/automotive/openadkit2_safetyisolation/security_group.jpg differ diff --git a/content/learning-paths/automotive/openadkit2_safetyisolation/split_aws_run.gif b/content/learning-paths/automotive/openadkit2_safetyisolation/split_aws_run.gif new file mode 100644 index 0000000000..fd36faa13b Binary files /dev/null and b/content/learning-paths/automotive/openadkit2_safetyisolation/split_aws_run.gif differ