▶ Try it its model runs in your browser, nothing to install
arche/ros2-rover
ROS 2 rover
A rover as ROS 2 nodes: a lidar driver, a planner that slows and stops before an obstacle, and the motors; a simulated world closes the loop, so the test plan runs in the simulator. The nodes are generated as rclcpp packages for colcon.
ros2robotroverlidarplannermotorscolconstarter
archec add main.arche arche/ros2-rover@^0.1
Package
| Kind | template |
|---|---|
| Version | 0.1.0 |
| License | Apache-2.0 |
| Export control | none |
| Works with | archec >=0.10 |
| Edition | 0.12 |
| Handlers | Python from its code |
| Home | https://github.com/arche-lang/arche-lang |
Model
| Systems | Robot |
|---|---|
| Components | Lidar Planner Motors World |
| Requirements | 3 |
| Messages | 4 |
Code it brings
| Where | Language | Lines |
|---|---|---|
main.arche · Lidar.on_raw.body | arche | 3 |
main.arche · Planner.on_obstacle.body | arche | 12 |
main.arche · Motors.on_cmd.body | arche | 1 |
main.arche · World.on_wheels.body | arche | 2 |
main.arche · World.main.body | arche | 6 |
tests/ros2_check.py | python | 135 |
ROS 2 rover
A rover as ROS 2 nodes. The lidar driver checks each reading (0.1 to 12 m, or not valid), the planner drives toward what is ahead at 1.5 × (distance − 0.3 m), at most 0.5 m/s, and stops 0.3 m before it, and the motor driver turns the speed into the two wheel speeds. The world moves the rover by them and gives the lidar the distance left: 3 m to a wall at the start.
| | | |---|---| | Nodes | lidar, planner, motors (with --kind ros2, a process each on a Linux computer, packaging ros2) | | Plant | world (kind plant): simulated with the model, not a node | | Requirements | REQ-RV-STOP (stop no closer than 0.25 m, within 10 s), REQ-RV-SPEED, REQ-RV-BLIND (not valid: 0 m/s) | | Test plan | TP-RV: it stops, within the speed limit, blind it stops |
archec new my-robot --kind ros2 a project from it, its nodes in src/
archec test main.arche the test plan, in the simulator
python3 tests/ros2_check.py --static the ROS 2 package files, without ROS
python3 tests/ros2_check.py with ROS 2 and the workspace built: the nodes, live
In the simulator the rover stops 0.32 m from the wall at 6.6 s.
Versions
| Version | Published | archec | State |
|---|---|---|---|
0.1.0 | 2026-11-12 | >=0.10 | public |
Signature
Signed by arche with key e660d0a8851875b9. Files: 4, fingerprint sha256-1c9f34a1188ffda99af6…. archec add checks both before it writes anything.
Discussion
Loading…