Skip to content

About

LunCoSim workshop Twins: drive a rover 500 m to a crater rim, start and solved states

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rover competition: crater rim traverse

A workshop exercise for LunCoSim, an open-source co-simulator for space missions. Install a nightly build, then clone this repository and open one of the two Twins.

Five rovers at the start of the battery sweep

Two complete Twins of the same mission. start/ is what the students get. solved/ is one answer to compare with, not the only one. The mission and its four requirements are in BRIEF.md inside each Twin.

Measured result R1 distance R2 battery R3 tilt R4 estimator error Verdict
start/ (12 Ah, straight over the ridge) 504 m 2.8% 26.0 deg 45.4 points FAIL
solved/ (15 Ah, around the ridge) 521 m 26.6% 8.5 deg 4.3 points PASS

Run it

Open the folder start with File -> Open Folder/Twin... The drive starts by itself after two seconds. It takes about 10 minutes at normal speed, so use the headless run for checking. That takes about a minute:

luncosim test --scene /full/path/to/start/scene.usda --max-ticks 80000

Student tasks

  1. Run start and read the verdict. Which requirements fail, and why?
  2. R3, route. Move route points P1 and P2 in scene.usda so the rover goes around the ridge. The ridge covers x from -30 to 30.
  3. R4, model. In models/EnergyEstimator.mo, replace the two TODO lines. Use the charge spent so far and the distance left. A good first job for the AI.
  4. R2, trade study. Find the smallest battery that passes: open sweep.usda (see below), or run python3 sweep.py start 12 13 14 15 16.
  5. Change one thing at a time and keep each verdict as evidence.

Sweep inside the simulator

Open sweep.usda from either Twin. Five rovers drive your route side by side with 12 to 16 Ah batteries. Each result appears on screen as PASS or FAIL for R2 and R3, then the smallest battery that passes. It reuses scene.usda, so your route changes apply by themselves. To try other sizes, edit the inputs:capacity values in sweep.usda.

Sweep results on screen: 12 and 13 Ah fail, 14 Ah and above pass

The script asks for 8x speed. How fast it really runs depends on the computer: one run took 6.5 minutes in the window on a busy machine, and about 3.5 minutes headless:

luncosim test --scene /full/path/to/start/sweep.usda --max-ticks 80000

This is also the pattern for a startup script: a Program prim in the scene that points to a .rhai file runs when the scene opens. See Sweep at the end of sweep.usda and scenarios/tests/battery_sweep.rhai.

What differs in solved/

  • scene.usda: P1 and P2 at x = 45; inputs:capacity 15 instead of 12.
  • models/EnergyEstimator.mo: average charge per metre, times the metres left.
  • The name and description in twin.toml.

Trade study on solved/: 13 Ah fails (15.3% left), 14 Ah passes (21.4%), 15 Ah passes (26.6%). The smallest passing size of those is 14 Ah; 15 Ah is used for margin.

Possible follow-ups: make the estimator account for the climb at the end; slow down with inputs:cruise_throttle; add solar generation; change the rover.

A custom key

input.json in each Twin binds the key T to the RunLint command. Change the key or the command to make your own controls.

Status

The results above are from headless runs on 3 December 2026 with a development build of LunCoSim. Run both Twins on your own build before relying on them.

Licence

MIT, see LICENSE.

About

LunCoSim workshop Twins: drive a rover 500 m to a crater rim, start and solved states

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages