Jump to content

Timelapse of autonomous rover on Duna (kOS mod)


check

Recommended Posts

A couple of months ago, I wrote a script for the kOS mod which would autonomously guide a rover across Duna. It's a little more complicated than just setting a waypoint in the script and locking the wheels to that location. If you've used kOS with rovers you'll know that as soon as you hit an incline your rover will go mad and flip over if it's locked to a target. The script accounts for the rovers speed and attitude by unlocking the wheels over uneven ground and only making adjustments to heading when the speed is low.

Anyway, here's the video! It takes place over 4 hours but the time has been sped up by a factor of 80.

Link to comment
Share on other sites

Nicely done!

Is the script specific to that rover?

What was the rover's average speed?

The script can be used for any rover, I suppose. It does have a couple of lines in there that checks if the solar panels are catching the sun and if not, it turns on the headlights :)

The version of the script I have saved now says I had the nominal speed set to about 14 m/s (this was a couple of months ago) but I think with this run I set it lower--maybe 8-10 m/s?

kOS really lags the game after running it continuously for more than 15-20 minutes so the drive was actually slower and more laggy.

Code:



clearscreen.
Print "Duna Pole to Pole by check".
set waypoint1 to latlng(-41,-10).
set waypoint2 to latlng(-35,-18).
set waypoint3 to latlng(-28.5,-24.3).

set waypoint4 to latlng(-28.3,-30.2).
set waypoint5 to latlng(-19,-42).
set waypoint6 to latlng(-7.8,-35.9).

set waypoint7 to latlng(1,-19).
set waypoint8 to latlng(4.6,-13.8).
set waypoint9 to latlng(8,-5.5).

set waypoint10 to latlng(17,17).
set waypoint11 to latlng(31,37).
set waypoint12 to latlng(47.5,44.8).



set nextwaypoint to waypoint1.
set w to 1.
until w = 13 {
lock wheelthrottle to -0.2.
wait 3.
lock wheelsteering to nextwaypoint.
lock wheelthrottle to 0.1.
wait 5.
lock wheelthrottle to 0.5.
until nextwaypoint:distance < 50 {
print "Waypoint "+w+ " "+nextwaypoint distance at (3,3).
if inlight = "True" {lights off.}.
if inlight = "False" {lights on.}.
set x to up - facing.
set attitude to sqrt((x:pitch)^2+(x:yaw)^2).
if attitude > 2 {unlock wheelsteering.}.
if surfacespeed > 14 {lock wheelthrottle to 0.1.}.
if surfacespeed < 14 {lock wheelthrottle to 0.5.}.
if surfacespeed > 18 {lock wheelthrottle to -0.1.}.

if attitude < 2 {lock wheelsteering to nextwaypoint.}.
}.
set w to w +1.
if w = 2 {set nextwaypoint to waypoint2.}.
if w = 3 {set nextwaypoint to waypoint3.}.
if w = 4 {set nextwaypoint to waypoint4.}.
if w = 5 {set nextwaypoint to waypoint5.}.
if w = 6 {set nextwaypoint to waypoint6.}.
if w = 7 {set nextwaypoint to waypoint7.}.
if w = 8 {set nextwaypoint to waypoint8.}.
if w = 9 {set nextwaypoint to waypoint9.}.
if w = 10 {set nextwaypoint to waypoint10.}.
if w = 11 {set nextwaypoint to waypoint11.}.
if w = 12 {set nextwaypoint to waypoint12.}.
}.
lock wheelthrottle to -0.1.
wait until surfacespeed < 3.
brakes on.
unlock all.

It only made it past waypoint 1.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...