Space Engineers

Space Engineers

143 个评价
Sam's Autopilot Manager
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
46.775 KB
2017 年 12 月 7 日 下午 5:39
2019 年 2 月 13 日 上午 11:38
9 项改动说明 ( 查看 )

订阅以下载
Sam's Autopilot Manager

描述
Warning, this version is deprecated. See SAMv2 here.

Donations
I have a day job. Please buy food and donate it to your local homeless shelters instead.

Updates
  • Added support for multiple cameras;
  • Notifications for remote controll and camera detection;

What
  • Have your ship autonomously fly safely and effectively to any location in a planet, without having to worry about adding several waypoints. Just the destination one.
  • Turn your ships into autonomous navigation vessels. Without a need for a cockpit, just tell it where you want to go, and it goes, with or without you as a passenger.
  • Automate cargo runs with ease. Worry only about giving it the source and destination. Or give it multiple destinations, up to you.
  • Worried about mountains and collisions? Worried about your Remote Controller getting stuck? Don't worry anymore.

What is not
  • This is not a script to have your ships navigate through mazes. Make sure you have clearance for the approaches;

Why
Automating flight runs on a planet requires much effort and is not reliable. The waypoint management system is cumbersome. The Remote Controller Autopilot is a potato on the stick. There needs to be a better way.

How
A management system that oversees the Remote Controller autopilot. It abstracts the Remote Controller utilization with simple commands. In addition, this system prevents situations where the Remote Controller could get stuck and provides the user with diagnostic tools to avoid it.

Installation
Required:
  • Remote Controller - Add one to your ship. As closest as possible to the ship's center of mass (see below how). If you have more than one Remote Controller in the grid, tag the prefered remote's name with [SAM].
  • Camera - Add at least one to your ship, facing the forward direction (same as the remote controller). Make sure there are no obstructions in front of the camera. This will be used for avoiding obstacles. Tag this block's name with [SAM]. Adding a second camera facing down will greatly improve navigation in extreme mountainous scenarious.
  • Text Panel - Add one for managing the docking locations. Tag this block's name with [SAM].
  • Programmable block - Add one to your ship, add this script to it. No need for timers;
Optional:
  • Text Panel for Diagnostics - Tag a text panel with [SAM diag]; This is used to display several diagnostic stats. What is the distance of the remote control from the center of mass. What are the maximum accelerations in every direction for your ship’s grid.
  • Text Panel for System Logs - Tag a text panel with [SAM log]; This displays an audit of what the system is currently doing.
  • Text Panel for GPS - Tag a text panel with [SAM gps]; This exports all the coordinates such that they can be copied to the GPS if needed.

Usage
Issue the following commands to the Programmable Block:
  • DOCK REGISTER - Registers the ship’s present location as a docking location. Make sure the ship is leveled.
  • DOCK DELETE - Deletes the selected dock (the selected dock can be seen on the text panel).
  • DOCK PREV - Selects the previous dock.
  • DOCK NEXT - Selects the next dock.
  • NAV START - Starts navigation to the selected dock.
  • NAV STOP - Immediately stops navigation.
  • NAV FAR - Select and navigate to the farthest configured dock.
  • NAV NEAR - Select and navigate to the nearest configured dock.
  • DIAG - Changes tabs on the Diagnostics text panel.

Notifications
Notifications can be sent to other blocks when certain actions are accomplished.

Programmable blocks
Any programmable block tagged with [SAM NOTIFY] will be executed with the following arguments:
  • NAV APPROACH - When the ship is approaching a dock location.
  • NAV FINISH - When the ship lined up and the remote control stopped.
Timers
Will be triggered or started when the program stops. Tag your timers with:
  • [SAM START] - Starts the timer.
  • [SAM TRIGGER] - Triggers the timer.
Connectors
Will Disconnect/Connect when the program starts/finishes. Tag them with [SAM].

Tactical
  • Approach - The ship will approach the dock location in the same orientation it was first configured. So make sure there is enough clearance above and behind for the approach.
  • Withdraw - When the ship is in a docking location (it knows this if the docking location is registered) it will withdraw backwards along the same approach vector.
  • Center of mass - there is a bug where if the remote controller is too far from the center of mass the autopilot will fail to reach the exact destination. So, keep the remote controller as close to the center of mass of the ship as possible. If not immediately on the center, put it above or below as opposed to the sides. The diagnostics Text Panel will provide actual information. It will warn if the distance is larger than 2m.
  • Acceleration - Your ship's acceleration, in each direction, is a product of your ships thrust and mass. For the autopilot to work properly (several tests) I recommend the acceleration in the Up, Down, Forward, Backwards directions be above 2m.s-2. The diagnostics panel will display more info and warnings about it.
  • Terrain and grid avoidance - The autopilot manager will avoid mountains, general terrain and large grids. It will do this only during navigation. Not during approach or withdrawal.
  • Same Grid - SAM will work with blocks on the same grid only. Except for Text Panels which can be in any grid. Use the tag to disambiguate.
  • Storage - The docks are stored in persistent storage. The system will continue working normally if the game is loaded or saved or interrupted.
  • Registering docks - Make sure the ship is leveled properly. The autopilot will deliver it in the same exact location facing the same exact direction and perfectly leveled.

Forward thinking
I have several prototypes for space and orbital functionalities. I may add to this script if enough people use it.

Contributions
Feel free to send contributions to the Github[github.com] repository. Add your name to the contributors.
131 条留言
Spite 2020 年 5 月 25 日 下午 12:52 
@FlyingMachineGun, you might have better luck if you switched to SAMv2, which is the updated version of this script. Not sure whether this one still works
Prison Mike 2020 年 5 月 25 日 下午 12:12 
For some reason i cant assing my antenna to the PB.. Anyone know a solution?
Magistrator  [作者] 2019 年 2 月 13 日 上午 11:35 
LisanAlGaib 2019 年 2 月 3 日 上午 12:25 
I had to learn a bit more about the stock autopilot to figure out what was going wrong. I did not have any downward facing thrusters, which cause the stock autopilot feature that your script manages to lose it's ♥♥♥♥.
Anyone having problems like I did, put some thrusters in every direction, even toward gravity. It improved functionality by a lot.
LisanAlGaib 2019 年 2 月 2 日 下午 9:08 
Thanks for that. Maybe I'm doing something wrong, but when I start navigation to a different point, the script get perpetually stuck in the "withdrawing" step, but doesn't actually move. If I manually withdraw it though, and start the nav while already in the air, it proceeds to the destination. Have I set something up wrong?
I also observed that when I am able to get it to navigate to the point, once it gets there, it manages to get within like a meter or two from the connector, but then lightly spins and rises higher until I cancel the nav and land it myself.
Final note: I have not changed anything in the previously suggested code as of yet.
Magistrator  [作者] 2019 年 2 月 2 日 上午 6:28 
Kerberos, for version SAMv1 you can play with these values:
https://github.com/sugardose/SpaceEngineers/blob/master/SamsAutopilotManager.cs#L26
LisanAlGaib 2019 年 2 月 1 日 下午 7:56 
Approach/Withdraw both mention orientations and vectors seemingly being remembered or at least reused. Is there a method that can be used to influence these?
Darian Stephens 2019 年 1 月 30 日 下午 7:35 
I am very much looking forward to it. I tried the original SAM a few times but it never quite worked out, always ended up overshooting the connector and smashing the drone in to things.
Here's hoping that SAMv2 solves this issue!
Magistrator  [作者] 2019 年 1 月 30 日 下午 2:55 
Folks, I am done with SAMv2. I will release it in the coming week. Highlights are: working with, without and alternating gravity; auto dock learning - no more need to program coordinates; Much better path finding.
I will take some of days to do the documentation and some videos to help who ever uses this. If anybody is interested to do a tutorial video, do let me know.

Note: the new version will be a new Script. I wont replace this one because it fundamentally changes some functionalities and I dont want to catch users by surprise.
Darian Stephens 2019 年 1 月 12 日 上午 6:50 
Version 2 has been planned for quite some time, which will work in both Gravity and Space, with easy transitions between each.
Version 1 is only intended for planets, though.