Space Engineers

Space Engineers

DAS - Driver Assisting System
 This topic has been pinned, so it's probably important
Wanderer_308  [developer] 19 Feb, 2019 @ 11:21am
Script setup
List of used terms:
  • PB - Progrmmble Block.
  • RC - Remote Control block.
  • Main grid - grid where sets PB and RC bloks.
  • Subgrid - any other grid connected to the main grid via rotors and/or pistons.

General setup
The bare minimum to set up the DAS is enough two blocks: Programmable block and Remote Control blocks. Also, there are two additional requirements. First, these blocks should be placed on the main grid. Second, the RC block should be orientated correctly, i.e. RC's front point in the vehicle's forward direction and RC's up to vehicle's up.

Other blocks such as thrusters, gyroscopes, suspension wheels, LCD panels, an artificial mass may or may not be on the grid and/or subgrids. If these blocks installed on the same grid as PB blocks DAS will detect them automatically. In case if you want to exclude some blocks from script's detection put in such block's Custom Data keyword (not case sensitive):
DAS_IGNORE. This keyword applies to gyros, thrusters and suspension wheel blocks.
Also, DAS keeps track of vehicle mass and re-detect functional blocks when the grid was changed. Therefore you don't need to recompile the script when you add or remove blocks.

Text Panels and cockpit's LCDs
The DAS can output some text data to LCD panels of Text Panel and cockpit blocks. For that, you need to put in Text Panel or cockpit Custom Data property special keyword and a numeric index of LCD in this block. For Text Panels this index is always 0. For other blocks, it's from 0 to number of LCDs minus one.
For example, if the cockpit has this list of LCDs:
  • Top Center Screen
  • Top Left Screen
  • Top Right Screen
  • Keyboard
Then for center screen index is 0, for the left screen it's 1, for right one it's 2, and for the keyboard it's 3.
Currently, there are two available keywords: DAS_navigation and DAS_status.
Marking block with DAS_navigation and index number will make script output navigation data, like GPS position, velocities, acceleration, yaw, roll, and pitch angles.
Marking block with DAS_status and index number will make script output its status data, like availability of scripts subroutines and functions.

Use example. Let's say we want to make the script to output navigation data in cockpit's left screen, and status data in the same cockpit's center screen. Then in its Custom Data property we should type this:
DAS_navigation 1 DAS_status 0

Programmable Block LCD
DAS's programmable block can output runtime info (one that could be seen in the terminal menu) in its LCD. For that in PB's terminal menu set the Content Type 'Text and image' for its main screen.

Subgrid wheels
DAS support suspension wheels on subgrids. However, it will not detect them automatically. To make DAS work with such wheels you have to group all subgrid suspension wheels to a group named 'Subgrid Wheels'. Of course, you can name it another way, but then you should change the expected group name in _SubgridWheelsGroupName variable in the script. DAS will treat such wheels in the same manner as regular (none subgrid) wheels and will relay user control to them, i.e. will set propulsion override and steering override.
NOTE 1: In case if subgrid wheels connected to the main grid with a movable hinge (like trailers) then you need to make sure that such trailer and the main grid should be aligned in a straight line along longitude axel at the moment of script compilation. Otherwise, the script will calculate some properties with errors.
NOTE 2: For brakes and handbrakes could work on subgrid wheels all wheeled subgrids should have RC block, or any other cockpits/pilot set.

Gyroscopes
The script only works with gyroscopes placed on the main grid. An orientation of gyroscope blocks doesn't matter. The DAS will detect gyroscopes automatically, so no additional naming or grouping needed.

Thrusters
The script only works with thrusters placed on the main grid. The DAS will detect thrusters automatically, so no additional naming or grouping needed.

Lights
To make the script work with lights designated to be stop lights just group them in 'Stop lights'.
To make the script work with lights designated to turn lights just group them in 'Turn lights'. Additionally, every light block should have in its Custom Data property one of two keywords: LEFT or RIGHT.
All these light blocks may be on subgrids.

Back-up beeper
To make the script work with sound block designated to be back-up beeper its name should contain 'Back-up beeper' text. There may be several sound blocks with this text, and these blocks may be on subgrids. All properties on sound blocks such as Loop Time, Range, Sound, etc. should be set manually.

Autopilot Trigger Timer
Autopilot can trigger specific Timer Block at every waypoint it passes, including very first and very last one. For that, this Timer Block should be named exactly as 'Timer Block DAS Waypoint'. The name, of course, could be changed in _AutopilotTimerName variable in the script.

Script arguments
Supported script arguments (all not case sensitive):
  • STARTSTOP - toggle DAS on/off.
  • START - start the script.
  • STOP - stop the script.
  • LOW_MODE - lower suspensions height offset.
  • HIGH_MODE - rise suspensions height offset.
  • RESET_ODOMETER - reset traveled distance.
  • CYCLE_HANDBRAKES - change auto handbrakes mode.
  • TOGGLE_JUMPJETS - toggle whether to engage upward thrusters when Spacebar pressed or not.
  • TOGGLE_GSA - toggle gyros override on/off.
  • TOGGLE_HDC - toggle HDC functionality.
  • TOGGLE_AUTOPILOT - toggle autopilot on/off and reset it to the first waypoint.
  • RESUME_AUTOPILOT - toggle autopilot on/off without reset.
  • CYCLE_AUTOPILOT_ACC - change autopilot accuracy.
  • CYCLE_AUTOPILOT_WAIT - change wait time in a sec, the autopilot will wait at every waypoint.
  • CYCLE_AUTOPILOT_MODE - change autopilot drive mode.
  • INVERSE_AUTOPILOT - inverse waypoints order in RC block.
  • TOGGLE_CRUISECONTROL - toggle cruise control on/off.
  • TOGGLE_GPSTRACKER - toggle GPS waypoints tracking.
    TOGGLE_GPSLIST - show/hide tracked GPS waypoints list on 'Status' screen.
Last edited by Wanderer_308; 3 Nov, 2019 @ 2:45pm
< >
Showing 1-15 of 96 comments
EMEUTIER 22 Aug, 2019 @ 10:42pm 
is there a way to display DAS_navigation and DAS_status on the lcd panel instead of the runtime output?
Wanderer_308  [developer] 23 Aug, 2019 @ 7:38am 
@EMEUTIER, you mean output navigation and status into PB's LCD? Sure, just put appropriate keywords to the Custom Data.
Ferro 28 Jan, 2020 @ 10:39am 
something wrong with the autopilot wait variable I think. I tried to set the wait time to 0 in the script but it still defaults to 5 seconds unless I execute the cycle command a few times

Last edited by Ferro; 28 Jan, 2020 @ 10:44am
ZettDeEff 14 Apr, 2020 @ 12:46pm 
Originally posted by Ferro:
something wrong with the autopilot wait variable I think. I tried to set the wait time to 0 in the script but it still defaults to 5 seconds unless I execute the cycle command a few times

I got the same issue atm. Also with Command to Stop Autopilot. I was able to avoid this by briefly activating the cruise control via a shortcut in the action bar and directly deactivating it again to stop the autopilot.
Wanderer_308  [developer] 3 Jun, 2020 @ 12:43pm 
nani?
superstarhero 13 Jun, 2020 @ 9:33pm 
Great script, its really helping my large grid mobile base get around, however the handbrakes won't turn on when I leave the control seat.
I've got my wheels on 4 sub grids connected by rotors to the main grid; all the sub grids have RCs on them and I can see the handbrake is being used when I press space (through assigning the remotes to the tool bar). If I try and manually tick the handbrake on the RC in control panel, it auto unticks. The wheels are functioning fine otherwise. I've tried removing and re-adding all the RCs and control seat, toggling CYCLE_HANDBRAKES, but no luck.
Any thoughts on what I am doing wrong? Thanks.
Wanderer_308  [developer] 14 Jun, 2020 @ 5:53am 
Does your mobile base build with any chassis incline? Like it titles down/up by design? If so then you should set this pitch angle in the script settings.
superstarhero 14 Jun, 2020 @ 1:32pm 
Not intentionally. I added a rotor pendulum swing to the roof to check and it thinks its level. I tried setting _NaturalPitchDegree to 1 and -1 just in case but no luck. Below are a couple of screen shots of it.
https://steamproxy.net/sharedfiles/filedetails/?id=2130672116
https://steamproxy.net/sharedfiles/filedetails/?id=2130672406
Wanderer_308  [developer] 14 Jun, 2020 @ 4:20pm 
RC block on the main grid i suppose oriented correctly?
superstarhero 14 Jun, 2020 @ 4:40pm 
Yep, I've removed it and tried it another location as well. I do have some other RC blocks connected via merge blocks for missiles and RCs on the attached ships, but i've put an DAS_IGNORE in all their custom data
Edit: After a bit more testing with your script I've found the RC handbrakes will activate on leaving the control seat if there is also a wheel suspension block on the main grid. But what I've also discovered is that I don't really want it to activate the 'P' key handbrake when i leave the control seat as it will disconnect my docked vehicles. However I would like to be able to manually turn on the subgrid's RC handbrakes via the tool bar. Is that possible? At the moment the subgrid RCs handbrake setting is being overwritten by the script, but if I set the RCs to DAS_IGNORE I lose the ability to use the handbrake with Spacebar (which is super handy).
Last edited by superstarhero; 15 Jun, 2020 @ 2:06am
Wanderer_308  [developer] 15 Jun, 2020 @ 8:08am 
Yeap, found the issue. If the main grid has no wheels the RC's property 'Handbrake' is inaccessible, you can see it in the terminal menu. Yet if you hit P, or use toolbar action, this property ticks on/off. Guess i can sign it on Keen's bug "account". Fortunately, i also found a workaround, you have to replace several lines.

First, replace all lines matches:
RC.HandBrake = true;
with line:
RC.SetValueBool("HandBrake", true);

Second, replace all lines matches:
RC.HandBrake = false;
with
RC.SetValueBool("HandBrake", false);

And finally:
RC.HandBrake = WaitTimeSec > 0;
with
RC.SetValueBool("HandBrake", WaitTimeSec > 0);

As for using toggling brakes with a toolbar, you just need to do it with min grid RC block, not subgrids one. The script will translate the state of this property to subgrid RCs.
Last edited by Wanderer_308; 15 Jun, 2020 @ 8:25am
superstarhero 15 Jun, 2020 @ 4:37pm 
LEGEND! Thanks for sorting this, it works like a charm.
Toshio 20 Jul, 2020 @ 6:17pm 
Great script, yet I'm having issues configuring it, system checks are telling me most of the systems are ok, but I can't make work any of the parameters of the scrit: TOGGLE_CRUISECONTROL, HIGH_MODE, LOW_MODE, etc.
The only one that works is STARTSTOP.
Even the lights, although I have created the group "Stop lights", with two corner lights, and the programmable block states lights are ok, they do not work, as well as the beeper, named as per instructions.
Does it conflict with fancy LCD by any chance? Or the easy dock script v2? I do not see any error message anywhere tho. Or can be low performance? My pc runs very low (I'm below minimum requirements), yet, the script takes like 0.01 secs to run, and others are working fine.
Or can be the drone attached to one of the connectors?
Wanderer_308  [developer] 20 Jul, 2020 @ 6:37pm 
"Or can be the drone attached to one of the connectors?"
That's probably it. DAS goes in standby mode when the rover is docked via connectors, so it's safe for transportation and almost not using CPU resources. Add keyword DAS_IGNORE to the connector's Custom Data so the script will not check this connector.
Last edited by Wanderer_308; 20 Jul, 2020 @ 6:38pm
Toshio 21 Jul, 2020 @ 12:28pm 
Originally posted by Wanderer_308:
Add keyword DAS_IGNORE to the connector's Custom Data so the script will not check this connector.
Thanks, I realized it when the drone was not attached today. I'll try adding that to the rover's drone.
Pretty awesome script, now I want to try the autopilot.
< >
Showing 1-15 of 96 comments
Per page: 1530 50