▶ Try it its model runs in your browser, nothing to install

template · verified

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

Kindtemplate
Version0.1.0
LicenseApache-2.0
Export controlnone
Works witharchec >=0.10
Edition0.12
HandlersPython from its code
Homehttps://github.com/arche-lang/arche-lang

Model

SystemsRobot
ComponentsLidar Planner Motors World
Requirements3
Messages4

Code it brings

WhereLanguageLines
main.arche · Lidar.on_raw.bodyarche3
main.arche · Planner.on_obstacle.bodyarche12
main.arche · Motors.on_cmd.bodyarche1
main.arche · World.on_wheels.bodyarche2
main.arche · World.main.bodyarche6
tests/ros2_check.pypython135

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

VersionPublishedarchecState
0.1.02026-11-12>=0.10public

Signature

Signed by arche with key e660d0a8851875b9. Files: 4, fingerprint sha256-1c9f34a1188ffda99af6…. archec add checks both before it writes anything.

Discussion

Loading…