Difference between revisions of "Simulator"
(→Changes) |
Elcanoadmin (talk | contribs) (→Overview) |
||
| (10 intermediate revisions by 2 users not shown) | |||
| Line 34: | Line 34: | ||
[[File:RouterBoard2020B.jpg|800px|]] | [[File:RouterBoard2020B.jpg|800px|]] | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
= 2026 Simulator = | = 2026 Simulator = | ||
| Line 142: | Line 40: | ||
=== Overview === | === Overview === | ||
| − | The 2026 simulator differs significantly from the original 2019–2020 | + | The 2026 simulator differs significantly from the original 2019–2020 CARLA-based simulator. While the original simulator focused on integrating the CARLA driving simulator with Elcano hardware through a Router Board, the 2026 effort focuses on lightweight vehicle simulation, hardware-in-the-loop testing, and future Jetson Nano integration. |
| + | |||
| + | Software for the newer simulator is on https://github.com/elcano/Bridge | ||
| + | |||
| + | Software for the older simulator is on https://github.com/elcano/Simulator | ||
=== Major Changes === | === Major Changes === | ||
| Line 220: | Line 122: | ||
* Improved support for CAN-based hardware-in-the-loop testing | * Improved support for CAN-based hardware-in-the-loop testing | ||
| − | ==Purpose== | + | == Purpose == |
| + | |||
| + | The 2026 simulator effort consists of two complementary systems: a desktop vehicle simulator and an Arduino Due hardware simulator. Together, these systems provide a safe and repeatable environment for developing, testing, and validating Elcano software without requiring a physical trike. | ||
| + | |||
| + | ==== Desktop Vehicle Simulator ==== | ||
| + | |||
| + | The desktop simulator provides a graphical representation of vehicle behavior using a simplified vehicle dynamics model. Its primary purpose is to: | ||
| + | |||
| + | * Visualize vehicle motion in real time. | ||
| + | * Demonstrate the effects of throttle, steering, and braking inputs. | ||
| + | * Validate vehicle motion algorithms before deployment to hardware. | ||
| + | * Generate logged data for analysis and debugging. | ||
| + | * Provide a lightweight alternative to CARLA for rapid software testing. | ||
| + | |||
| + | By simulating vehicle position, heading, speed, and steering behavior, developers can quickly evaluate software changes without requiring specialized hardware. | ||
| + | |||
| + | ==== Arduino Due Hardware Simulator ==== | ||
| + | |||
| + | The Arduino Due simulator functions as a hardware-in-the-loop testing platform. Rather than visualizing the vehicle, it emulates the sensors and feedback signals that would normally be produced by a physical trike. | ||
| + | |||
| + | Its primary purpose is to: | ||
| + | |||
| + | * Simulate wheel speed sensor outputs. | ||
| + | * Simulate steering sensor readings. | ||
| + | * Generate vehicle position and heading estimates. | ||
| + | * Allow Drive-By-Wire (DBW) software to operate as if connected to a real vehicle. | ||
| + | * Support CAN communication testing between vehicle subsystems. | ||
| + | * Enable bench testing without risk of damage to physical hardware. | ||
| + | |||
| + | This allows developers to observe how the Drive-By-Wire system responds to simulated vehicle behavior before testing on a physical platform. | ||
| + | |||
| + | ==== Combined Purpose ==== | ||
| + | |||
| + | Together, the desktop simulator and Arduino Due simulator reduce development risk, accelerate testing, and provide a foundation for future Jetson Nano integration. The simulator architecture enables software validation, CAN communication testing, and hardware-in-the-loop experimentation while minimizing the need for physical vehicle operation. | ||
| + | |||
| + | == Architecture == | ||
| + | |||
| + | The 2026 simulator architecture consists of two independent but complementary systems: a desktop vehicle simulator and an Arduino Due hardware simulator. | ||
| + | |||
| + | ==== Desktop Vehicle Simulator ==== | ||
| + | |||
| + | The desktop simulator is implemented in Python and uses the Pygame library for graphics and user interaction. | ||
| + | |||
| + | The simulator contains: | ||
| + | |||
| + | * A vehicle dynamics model that estimates position, heading, speed, and steering behavior. | ||
| + | * A graphical user interface that visualizes vehicle movement in real time. | ||
| + | * Keyboard-based control inputs for throttle, steering, and braking. | ||
| + | * CSV logging for recording vehicle state information during testing. | ||
| + | |||
| + | Vehicle state is updated at fixed intervals and displayed graphically, allowing developers to observe the effects of control inputs and verify simulator behavior. | ||
| + | |||
| + | ==== Arduino Due Hardware Simulator ==== | ||
| + | |||
| + | The hardware simulator is designed as a hardware-in-the-loop testing platform. It consists of a central CAN bus network connecting one or more Arduino Due boards that emulate vehicle subsystems. | ||
| + | |||
| + | Typical configuration: | ||
| + | |||
| + | * Central CAN bus communication network. | ||
| + | * One to three Arduino Due boards depending on testing requirements. | ||
| + | * Simulated sensor outputs including wheel speed and steering position. | ||
| + | * Drive-By-Wire (DBW) interface connections. | ||
| + | * Data logging through Serial or SD card storage. | ||
| + | |||
| + | The Arduino Due simulator generates the same types of signals that would normally be produced by a physical vehicle, allowing other Elcano subsystems to operate without modification. | ||
| + | |||
| + | ==== System Integration ==== | ||
| + | |||
| + | The simulator architecture is designed to support future Jetson Nano integration. | ||
| + | |||
| + | The intended communication path is: | ||
| + | |||
| + | Jetson Nano → CAN Bus → Drive-By-Wire (DBW) → Simulated Vehicle | ||
| + | |||
| + | In this configuration: | ||
| + | |||
| + | * The Jetson Nano performs navigation and waypoint processing. | ||
| + | * CAN Bus provides communication between subsystems. | ||
| + | * Drive-By-Wire interprets vehicle control commands. | ||
| + | * The simulator emulates vehicle sensors and responses. | ||
| − | + | This architecture allows software developed for the simulator to be transferred to the physical trike with minimal changes. | |
Latest revision as of 01:17, 12 June 2026
Contents
Elcano Carla Simulation External Specification
CARLA is an open-source driving simulator. During 2019-20 students develop3e a go-between circuit board to transfer data between CARLA simulation and the sensor slots of the Elcano hardware. The CARLA software allows users to emulate trike parameters under controlled conditions within a virtual world, providing an efficient system for testing sensor behavior, design implementation, and bench-marking overall vehicle progress. The CARLA software can simulate a variety of road conditions such as traffic patterns, inclines, and weather as well as provide users control over vehicle parameters including weight, engine power, and aerodynamic properties.
An Arduino Due serves as a router to transfer data from vehicle systems to CARLA under a variety of test conditions, enabling the software to replicate responses and return sensor data to be reevaluated for accuracy. The CARLA Micro-AV Bridge includes the Router, Sensor Hub and Drive-by-wire Arduinos. It permits testing the Elcano trike software, including camera, sonar, throttle, steering and brake systems. Simulation allows users to immediately see the results of adjustments to vehicle parameters and highlight physical aspects of the trike within the virtual environment. This project enables users to efficiently implement improvements and track the immediate effects of design changes without spending the time and resources it would take to transport or operate the trike in real world test scenarios. It enables developers to improve the software without needing to invest in a vehicle.
Purpose
The following is a generalized list of the desired functionality of the simulator.
- Simulate data for all sensors associated with Elcano Trike.
- Simulate Elcano behavior to throttle, brake, and steering.
- Have low and high-level boards function normally with the simulated sensor data without knowing data is being simulated.
- Allow low and high-level board interaction to be tested.
- Allow autonomous driving to be tested.
Components
Simulation Code to be executed by a computer that has access to a Carla server, either locally, or through a network. Controls all objects in Carla simulation. Retrieves sensor data from Carla, and sends router board. Also retrieves actuation instructions from the router board and sends to Carla.
Sensor Hub [aka High Level] Processor The same code is used for the virtual or physical vehicle, sending and receiving messages over the CAN Bus. The CARLA Bridge replaces sensor data that would normally come from instruments.
Drive-by-wire [aks C2 LowLevel] Processor Current Elcano Drive-by-wirel code. Actuator data is routed to CARLA.
Router Board Code is executed on the Arduino Due that functions as the router board. Routes commands from Drive-by-wire to Carla via Python scripts. Also routes sensor data from Carla to Sensor Hub processor.
2026 Simulator
Changes
Overview
The 2026 simulator differs significantly from the original 2019–2020 CARLA-based simulator. While the original simulator focused on integrating the CARLA driving simulator with Elcano hardware through a Router Board, the 2026 effort focuses on lightweight vehicle simulation, hardware-in-the-loop testing, and future Jetson Nano integration.
Software for the newer simulator is on https://github.com/elcano/Bridge
Software for the older simulator is on https://github.com/elcano/Simulator
Major Changes
| 2019–2020 Simulator | 2026 Simulator |
|---|---|
| CARLA-based simulation environment | Lightweight custom vehicle simulator |
| Required CARLA server and high-performance computer | Runs on standard desktop hardware |
| Router Board translated data between CARLA and Elcano hardware | Arduino Due directly simulates vehicle sensors and responses |
| High-Level navigation executed on Arduino Due Sensor Hub | Planned migration to Jetson Nano navigation computer |
| Focused on CARLA sensor emulation (GPS, vehicle state, etc.) | Focused on vehicle dynamics, sensor emulation, and DBW testing |
| Required multiple Arduino boards and CARLA infrastructure | Can operate as a standalone desktop or hardware-in-the-loop simulator |
| Primarily demonstrated communication between CARLA and Elcano subsystems | Primarily validates DBW behavior and prepares for Jetson Nano integration |
Desktop Vehicle Simulator
A new Python-based simulator was developed using Pygame. New functionality includes:
- Real-time vehicle visualization
- Vehicle position tracking
- Heading estimation
- Steering angle simulation
- Throttle delay modeling
- Momentum and friction modeling
- Brake simulation
- CSV data logging
This simulator provides a simple environment for validating vehicle motion without requiring CARLA.
Arduino Due Hardware Simulator
A new Arduino Due simulator was developed to emulate physical vehicle sensors. Features include:
- Simulated wheel speed pulses
- Simulated steering sensor outputs
- Vehicle position estimation
- Throttle response modeling
- SD card and serial logging
- Integer-only arithmetic for compatibility with project requirements
The simulator allows the Drive-By-Wire system to operate as though it were connected to a physical trike.
Jetson Nano Integration Path
The original simulator architecture relied on the Sensor Hub Arduino for navigation functions. The 2026 architecture is designed to support:
- Jetson Nano waypoint processing
- CAN-based communication with Drive-By-Wire
- Hardware-in-the-loop testing using simulated sensor data
- Future replacement of Sensor Hub navigation functionality
This allows navigation software to be developed and tested before deployment onto physical vehicles.
Benefits
The updated simulator architecture provides:
- Reduced hardware requirements
- Faster development cycles
- Lower risk of vehicle damage
- Easier debugging and testing
- Direct support for future Jetson Nano development
- Improved support for CAN-based hardware-in-the-loop testing
Purpose
The 2026 simulator effort consists of two complementary systems: a desktop vehicle simulator and an Arduino Due hardware simulator. Together, these systems provide a safe and repeatable environment for developing, testing, and validating Elcano software without requiring a physical trike.
Desktop Vehicle Simulator
The desktop simulator provides a graphical representation of vehicle behavior using a simplified vehicle dynamics model. Its primary purpose is to:
- Visualize vehicle motion in real time.
- Demonstrate the effects of throttle, steering, and braking inputs.
- Validate vehicle motion algorithms before deployment to hardware.
- Generate logged data for analysis and debugging.
- Provide a lightweight alternative to CARLA for rapid software testing.
By simulating vehicle position, heading, speed, and steering behavior, developers can quickly evaluate software changes without requiring specialized hardware.
Arduino Due Hardware Simulator
The Arduino Due simulator functions as a hardware-in-the-loop testing platform. Rather than visualizing the vehicle, it emulates the sensors and feedback signals that would normally be produced by a physical trike.
Its primary purpose is to:
- Simulate wheel speed sensor outputs.
- Simulate steering sensor readings.
- Generate vehicle position and heading estimates.
- Allow Drive-By-Wire (DBW) software to operate as if connected to a real vehicle.
- Support CAN communication testing between vehicle subsystems.
- Enable bench testing without risk of damage to physical hardware.
This allows developers to observe how the Drive-By-Wire system responds to simulated vehicle behavior before testing on a physical platform.
Combined Purpose
Together, the desktop simulator and Arduino Due simulator reduce development risk, accelerate testing, and provide a foundation for future Jetson Nano integration. The simulator architecture enables software validation, CAN communication testing, and hardware-in-the-loop experimentation while minimizing the need for physical vehicle operation.
Architecture
The 2026 simulator architecture consists of two independent but complementary systems: a desktop vehicle simulator and an Arduino Due hardware simulator.
Desktop Vehicle Simulator
The desktop simulator is implemented in Python and uses the Pygame library for graphics and user interaction.
The simulator contains:
- A vehicle dynamics model that estimates position, heading, speed, and steering behavior.
- A graphical user interface that visualizes vehicle movement in real time.
- Keyboard-based control inputs for throttle, steering, and braking.
- CSV logging for recording vehicle state information during testing.
Vehicle state is updated at fixed intervals and displayed graphically, allowing developers to observe the effects of control inputs and verify simulator behavior.
Arduino Due Hardware Simulator
The hardware simulator is designed as a hardware-in-the-loop testing platform. It consists of a central CAN bus network connecting one or more Arduino Due boards that emulate vehicle subsystems.
Typical configuration:
- Central CAN bus communication network.
- One to three Arduino Due boards depending on testing requirements.
- Simulated sensor outputs including wheel speed and steering position.
- Drive-By-Wire (DBW) interface connections.
- Data logging through Serial or SD card storage.
The Arduino Due simulator generates the same types of signals that would normally be produced by a physical vehicle, allowing other Elcano subsystems to operate without modification.
System Integration
The simulator architecture is designed to support future Jetson Nano integration.
The intended communication path is:
Jetson Nano → CAN Bus → Drive-By-Wire (DBW) → Simulated Vehicle
In this configuration:
- The Jetson Nano performs navigation and waypoint processing.
- CAN Bus provides communication between subsystems.
- Drive-By-Wire interprets vehicle control commands.
- The simulator emulates vehicle sensors and responses.
This architecture allows software developed for the simulator to be transferred to the physical trike with minimal changes.