Space Engineers

Space Engineers

Land based autonomous navigation (Land rover autopilot)
51 条留言
Marcvs101  [作者] 2021 年 9 月 24 日 下午 2:51 
DAS is also a nice script to play around with
This was made back when DAS didn't have the autopilot feature (I don't remember if it was in beta or entirely missing)
V L A X 2021 年 9 月 24 日 下午 2:41 
DAS - Driver Assisting System performs functions like this, though it is older
V L A X 2021 年 9 月 24 日 下午 2:40 
There is a driving script that performs a function like this if it's not working or doesn't provide enough features
Marcvs101  [作者] 2021 年 9 月 24 日 下午 2:37 
As far as we know, it should still work
Unfortunately, I have been away from the game, at first due to work and later on due to health issues, so I can't really confirm
Val  [作者] 2021 年 9 月 24 日 下午 1:32 
it should
Tommygunn 2021 年 9 月 4 日 下午 1:20 
Does it still work?
Val  [作者] 2021 年 4 月 19 日 下午 12:38 
I think it is enough to decrease the speed near the destination point (I am planning to implement it in the near future).
Then speed won't be high at the end - and on LowG brake shouldn't be an issue.
Marcvs101  [作者] 2021 年 4 月 19 日 上午 9:24 
About the handbrake true, in the past there have been issues in low g environments (the vehicle would flip over spectacularly).

Before I got overwhelmed with work, I was thinking about implementing a soft brake mechanism which would accelerate and decelerate taking gravity, CoG and inclination into account (basically a PID monitoring the torque of the wheels).

Thanks for the contributions, I have added you as an official contributor, btw
Val  [作者] 2021 年 4 月 19 日 上午 7:54 
prepared second PR (mostly refactoring, but also handbrake true when one way navigation finished)
Val  [作者] 2021 年 4 月 17 日 上午 4:59 
prepared first PR (for now only refactoring, as I am getting closer with the code)
Marcvs101  [作者] 2021 年 4 月 16 日 上午 7:03 
Another change that I wish to implement is to have steering and power handled by PIDs.
This allows for a proper and cleaner control (currently I ab use trigonometric functions)
Marcvs101  [作者] 2021 年 4 月 16 日 上午 6:59 
@Val Basically, what I attempt to do is using vector and matrix multiplication to translate global GPS coordinates into local coordinates.

The idea behind it is to project GPS points on the same plane of the vehicle and then use X and Z coordinates to compute steering.

This is why when you have a bank angle the rover will steer away from the point instead of keeping a straight line.

Unfortunately this process is heavy on the CPU, as such I wanted to find a simpler solution.
Val  [作者] 2021 年 4 月 16 日 上午 1:41 
That's perfect. I'll check it out.
Can you explain somewhere (discord?) the "all waypoints are translated onto the planet surface using wizardry and math".
I was testing your autopilot on the lake and it works perfectly. But then I went on the hills (not so big. They were totally passable) and rover starts lagging. It won't be able to go to the point. And my PC's fan starts working like crazy.
Marcvs101  [作者] 2021 年 4 月 15 日 上午 10:37 
@Val Sure, the repo should be https://github.com/Marcvs101/Space-Engineers-Land-based-autopilot

I haven't worked on the code for some months and some parts are due for a complete rewrite..
But I'll be more than happy to share the current state of the code around for improvements
Val  [作者] 2021 年 4 月 15 日 上午 2:45 
hi,
I'd like to contribute. Is the git source available?
Marcvs101  [作者] 2021 年 1 月 9 日 下午 12:56 
@Leafnie At the moment, it only just uses conventional steering, but the idea of using tank skid steering for some vehicles is nice. When I get to put my hands on the code, I'll surely try to implement something
V L A X 2021 年 1 月 7 日 下午 7:12 
Is it possible for this to work with something like a tank skid steering system? I doubt it but thought I'd ask.

https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=945775847&searchtext=skid+steering+
Niceguygamer 2020 年 12 月 7 日 下午 7:16 
Oh thank you, I like the idea that you have for using cameras for anti-collision that would really benefit.
Marcvs101  [作者] 2020 年 12 月 7 日 下午 7:12 
@🎃Niceguygamer🎃
Unfortunately the ingame API doesn't allow for me to know which actions are associated to each waypoint, I can only get a list of GPS coordinates.

However I have to thank you for bringing this issue to light, I will certainly try to conjure a way to mitigate this problem.

For the future I was thinking of a possible crude implementation of an anti collision system using a camera, along with some degree of information sharing between autopiloted grids in order to have convoy-like behaviours in which the one in front relays data about the track's condition to the ones in the back.
Niceguygamer 2020 年 12 月 7 日 下午 7:02 
Oh ok my rover is actually all heavy blocks so its quite heavy and my safe cruising speed is about 20-25 in the remote control. Is it possible to have each waypoints in the remote control activates a timer which will turn on brakes for a few seconds then disengaged it then continue to its next gps point.
Marcvs101  [作者] 2020 年 12 月 7 日 下午 2:04 
@🎃Niceguygamer🎃
Unfortunately the AI doesn't quite know where the brake pedal is..

Jokes aside, right now reaching the last waypoint disengages the autopilot.
I haven't found a way to pull the brakes yet without using the handbrake, which is not good at high speed..

I'll find a solution to this, but for now assume that your rover will roll a bit more from inertia after the last waypoint. A good "trick" would be to have a sharp turn at the end which inevitably slows the rover down, but i know it is not a solution.
Niceguygamer 2020 年 12 月 6 日 下午 7:47 
Why doesn't it stop when it reaches its gps point? Or am I doing something wrong?
Marcvs101  [作者] 2020 年 9 月 25 日 下午 1:34 
The speed reset on recompile is gone

Aswell as some nasty bugs that were in the code
Marcvs101  [作者] 2020 年 9 月 16 日 上午 9:36 
The last waypoint not being followed through is a bug I'll need to fix

For now the solution is to add the last waypoint twice

The handbrake feature is something I haven't tough of yet, i'll surely implement that
Azbc 2020 年 9 月 16 日 上午 7:18 
Could you add comand to disable handbreak when starts autopilot? And I dont know why it dont want to go to last waypoint when on one way mode
Marcvs101  [作者] 2020 年 9 月 14 日 下午 5:54 
It is at the bottom of the Program() function

Scroll down to the Save() function, which should be empty, then scroll back up until you see

remotePilot.SpeedLimit = 11f;//40km/h currently not in use

Comment that out (// at the beginning of the line) and you should be good to go

Again, sorry for the lazyness on my part, the code will be eventually polished and these little bugs will be fixed
Antit3rror 2020 年 9 月 14 日 下午 3:24 
Can u meantime tell me which line of script i have to change to remove that speed reset?
Marcvs101  [作者] 2020 年 9 月 14 日 上午 7:13 
@gloomis110
Unfortunately the script is not that precise to allow for docking yet

@Leafnie
Thanks!

@Antit3rror
I'll remove the speed reset on recompile. It was there only for testing and convenience, and it has not been removed since
Antit3rror 2020 年 9 月 13 日 上午 9:16 
Amazing script.
Is there a way to set speed in script? Everytime i reload save speed in remote control block goes back to 11.
V L A X 2020 年 8 月 29 日 下午 9:22 
Fantastic script - exactly what I needed
Eobard Thawn 2020 年 8 月 28 日 下午 1:24 
can this thing dock a rover to a connector?
Marcvs101  [作者] 2020 年 8 月 5 日 上午 3:46 
You do need a programmable block, aswell as scripts enabled for this to work.

Now that you made me think about it, I didn't include the programmable block in the requirements list..
Hadfield15 2020 年 8 月 4 日 下午 1:57 
Do I need a programmable block?
fakeplastictrunk 2020 年 4 月 30 日 下午 7:21 
Cool. Hopefully, I'll remember to, and if I do, I'd be happy to let you know. It may be some time before I implement it, but very cool script! Thank you!
Marcvs101  [作者] 2020 年 4 月 30 日 下午 12:31 
It should, as far as I am aware
If you can give it a try, I'll be glad to know how it turns out
fakeplastictrunk 2020 年 4 月 30 日 上午 11:49 
Does this work on custom planets?
Marcvs101  [作者] 2020 年 4 月 30 日 上午 6:55 
Oh lol
That explains the rover turning the wrong way, lol
Tonic 2020 年 4 月 30 日 上午 4:07 
fun fact my wheels were on upside down
Marcvs101  [作者] 2020 年 4 月 29 日 上午 4:06 
Hang on, I use the remote control's orientation as the forward direction
Is it possible that your remote control block is pointing backwards?
Tonic 2020 年 4 月 28 日 下午 1:40 
actually ya know what, it seems to just turn in the opposite direction of the way point and driving away from it. like 180degrees
Marcvs101  [作者] 2020 年 4 月 28 日 上午 8:22 
This is strange
Could it be a stability issue on the rover?
For example low gravity, high speed, and hard springs on the suspension assembly

Try to lower the speed, usually that works

As soon as I have time, i'll work on extra features, like actually decelerating before turning and an acceleration limiter to avoid capsizing.
Tonic 2020 年 4 月 28 日 上午 12:19 
im having an issue where my rover just swerves back and forth in a zigzag line and never actually drives to any said point
5ardaukar 2020 年 4 月 9 日 上午 3:19 
Thank You for this script, best "wheeled" autopilot i found yet... Just a small "bug": the circle command works fine, but if you try one way and just enter a single waypoint into the remote control block, it seems as if your script deletes the waypoint prior to executing... Sorry if my english isn´t as well as it should.
Marcvs101  [作者] 2020 年 4 月 5 日 下午 5:00 
Thanks again for the feedback

Regarding the auto-roll, the idea was not to rely on gyros for the script.
What I want to add, is a way to reduce the speed with respect of the radius of the turn or the angle of the craft

About the LCDs, Keen has updated the APIs regarding text panels to allow for custom GUIs, however, the system I use in the script hasn't been deprecated yet.
In the script, I handle screens as a list of IMyTextPanel elements.
I then scan this list and look for elements with either "autopilot" or "hud" in their "CustomName" peoperty.
If these are found, I print out basic information about what the autopilot is doing.

Unfortunately right now I am burdened by university work, however as soon as I'll have the time, i'll come back here and give a good troubleshooting and a needed update to the script.

As always, thanks for the feedback, I really appreciate it!
Immo 2020 年 4 月 5 日 下午 3:09 
Oh, one thing. The LCDs don't seem to work. Any tips for troubleshooting? Again, you're a legend man.
Immo 2020 年 4 月 5 日 下午 3:00 
It works flawlessly, why has keen not added this yet? You're an absolute wizard my dude
Paramecium 2020 年 4 月 3 日 下午 2:00 
Rover only gameplay here we go! How did i not see this script before nice job :steamhappy:
Bi0HazardXIII 2020 年 1 月 14 日 下午 8:31 
What about adding auto roll over just in case it flips? Or find a way that it hugs the ground alot more?
anrew10 2019 年 9 月 7 日 下午 1:15 
I’m hoping to use this with a formation script to have land based patrols going around my base
Marcvs101  [作者] 2019 年 5 月 3 日 上午 5:26 
Thanks for your feedback, it is really appreciated! :steamhappy:

Regarding the first suggestion, I certainly need to rework how waypoints are put and handled.
For now, the script pulls the first waypoint from the queue and either re-adds it at the end (if in circle mode) or discards it.
What I want to try to do, is keeping all the waypoints in the list and only changing the "current" waypoint.
There is an AddWaypoint command, but it feels too complex to be effective (fixed syntax and such). I will need to rewrite and make the whole parameter section easier to use, also taking into account inter-vehicular communication.

For the second suggestion, unfortunately I haven't found a way to access the actions linked to the GPS Waypoint.. That is a pity, since it would have been really useful.. I will try to find a workaround which isn't too cumbersome.