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

template · verified

arche/diff-drive-rover

Differential-drive rover

A rover on two driven wheels and a caster, with wheel encoders, an IMU and a GPS, and a navigator that follows waypoints by odometry: a heading and a speed loop; its plant in MuJoCo, its test cases run against it.

plantmujocoroverdifferential-driveodometrywaypointscontrol

archec add main.arche arche/diff-drive-rover@^0.1

Package

Kindtemplate
Version0.1.0
LicenseApache-2.0
Export controlnone
Works witharchec >=0.10
Edition0.12
Handlersthe action language (```arche), run as TypeScript from its code
Homehttps://github.com/arche-lang/arche-lang

Model

SystemsRover
ComponentsChassis Wheel Caster WheelMotor WheelEncoder Imu Gps Navigator
Requirements2
Messages4

Code it brings

WhereLanguageLines
main.arche · Navigator.on_left.bodyarche1
main.arche · Navigator.on_right.bodyarche1
main.arche · Navigator.on_fix.bodyarche2
main.arche · Navigator.reached.bodyarche13
main.arche · Navigator.on_motion.bodyarche29

Differential-drive rover

A 2 kg rover on two driven wheels and a caster ball, with an encoder on each wheel, an IMU and a GPS. The navigator follows three waypoints — (1, 0), (1, 1), (0, 1) — by odometry: the distance from the encoders, the heading from the gyro. A heading loop turns it toward the next waypoint, a speed loop slows it in the turns and near the waypoint (0.5 m/s at most), and it stops at the last. The GPS is the truth: when odometry says a waypoint is reached, the navigator records how far the GPS says it is (miss, worst_miss).

| | | |---|---| | Plant | a free chassis, 2 wheel hinges with velocity servos (kv 0.2), a caster (ball joint), 2 encoders, IMU, GPS, 1 ms step | | Controller | odometry, heading and speed loops, 100 Hz; Driving → Arrived | | Requirements | REQ-RV-WAYPOINTS (within 0.1 m of each, in 15 s), REQ-RV-SPEED | | Test plan | TP-RV: three waypoints, the speed limit |

archec new my-rover --template diff-drive-rover     a project from it, yours to change
archec gen main.arche --target mujoco -o out
archec sim main.arche --plant out/mujoco/plant_bridge.py --test
python3 out/mujoco/plant_bridge.py --viewer

In MuJoCo (4.0): the last waypoint reached at 10.4 s, the GPS at most 0.073 m from a waypoint when odometry said it was there. The wheels are spheres, so that their frames need no turning; the ground is MuJoCo's default plane.

Versions

VersionPublishedarchecState
0.1.02026-11-12>=0.10public

Signature

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

Discussion

Loading…