OHM Universal Autopilots 0.3.1

OrbitHangar

Addon Comments
Joined
Apr 9, 2008
Messages
3,832
Reaction score
13
Points
0

Author: artlav

Programmable autopilots &  flight manager for Orbiter.

Features:
-Configurable - want to take off from the Moon on retro engines? No problem. Want to launch upside-down? Granted. Etc.
-Sequenced - you give it a set of steps, it follow them, like from Earth to a Lunar station
-Vessel and MFD independent - you can fly as many vessels as you want and you can close the MFD whenever you want without interference
-Automatic time acceleration controls mode - it will slow down for maneuvres and speed back up during cruise
-Portable - works in Orbiter and in Spaceway
-Saveable - quit, restart, keep going

Autopilots supported:
-Lift off
-Runway lift off
-Aerial maneuvres
-Docking
-Final landing on a pad
-Align planes
-Sync orbits
-Hohman transfer to a moon
-Approach
-Attitude (Prograde, retrograde, up, nodes, etc)
-Maneuvres (burn by time or dv)
-Tools (press key for gears, wait for condition, undock, beep, start other vessel, etc)

Known issues:
-It appears that Shuttle Fleet uses something like engine gimballing for pitch control instead of RCS, making it uncontrollable for the UAP. Won't be easy to fix.
-Scram engines are not default, and thus cannot be accessed without vessel-side support
-Support for shutdown modes other than "Terminate Orbiter process" is undefined
-Estimated Time to End of Sequence (through entire sequence) is impossible to implement (reliably)

Changes since 0.3.0:
-Error reporting for failed sequences
-Error reporting on missing target vessel
-Docking AP time accel limit is now 10x
-Fixed docking & O2010P1 issues

-Maneuvre autopilot:
--Types:
---Burn timed
---Burn by DV
--Orientations (Absolute by nose):
---Prograde
---Retrograde
---From target
---Towards target

-Tools autopilot:
--Wait for distance


DOWNLOAD
 

Artlav

Aperiodic traveller
Addon Developer
Beta Tester
Joined
Jan 7, 2008
Messages
5,790
Reaction score
780
Points
203
Location
Earth
Website
orbides.org
Preferred Pronouns
she/her
Continuing UAP development, as stopped in 2010.
I don't quite remember what bugs i fixed over the year, so please report whatever of them you find.
Ideas are welcome too.

Old thread:
http://www.orbiter-forum.com/showthread.php?t=14704

Planned autopilots/features:
-Landing from orbit
-Targeted reentry
-Landing on runway
-Direct ascent
-Split hohmann into transfer and arrival
-Atmospheric flight by waypoints
-Better handling for air control surfaces
-Parallel sequencing (Like 100 seconds after start of lift-off press F to drop fairing kind of program)
-Multistage calculations for boosters
-Short burn mode
-Better flight error reporting

Coolest looking demos:
-Land-Moon pad hopping.scn, short fun
-2 DGs race from KSC to the Moon station.scn, long fun
-Launch-Many from the Moon.scn, medium fun
-Mission-DG from runway to ISS.scn, medium fun too

Have Fun!
 

Grover

Saturn V Misfire
Addon Developer
Donator
Joined
Oct 3, 2010
Messages
1,468
Reaction score
0
Points
0
Location
Ascension Island
only Artlav could take what we all KNOW to be impossible through the Orbiter API and make it into an addon. automatic Re-entry for un-pre-defined craft? ILS landing? direct ascent? you really are a C++ god :D
 

edsupagood

Addon Developer
Addon Developer
Joined
Oct 26, 2010
Messages
135
Reaction score
0
Points
16
Artlav I'm so happy you have come back to UAP, I have thought that the project became abandoned. Now that I see you working on it I'm overjoyed. Thanks :thumbup:
 

Eli13

Fish Dreamer
Joined
Mar 5, 2011
Messages
1,562
Reaction score
0
Points
0
Location
Somewhere, TN
you really are a C++ god :D

Well if He (as in Him) made everything run on C++, he might as well be. I've been waiting for something as amazing as this! I'm trying this as soon as I get home from vacation!

Cheers Artlav! :cheers:
 
Last edited:

Artlav

Aperiodic traveller
Addon Developer
Beta Tester
Joined
Jan 7, 2008
Messages
5,790
Reaction score
780
Points
203
Location
Earth
Website
orbides.org
Preferred Pronouns
she/her
automatic Re-entry for un-pre-defined craft? ILS landing? direct ascent?
Key word is planned. But sometimes the Universe refuse to cooperate.
 

Spacethingy

Multitasker
Joined
Sep 9, 2010
Messages
1,515
Reaction score
0
Points
36
Location
Not the anti-matter universe
Website
spacethingy.weebly.com
Oh wow. This is fantastic, thanks Artlav!

You've just messed up my early night, I've spent an hour gaping at Deltagliders doing things I've always wanted to do myself, but never quite cut it....

:thumbup:

PS Look forward to the docking AP getting fixed!
 

Chub777

New member
Joined
Dec 2, 2009
Messages
663
Reaction score
1
Points
0
Location
LEO
Continuing on from here...

I have set "Sync orbits" and "Approach" as the sequences (in order).
 

ky

Director of Manned Spaceflight
Joined
Jan 22, 2011
Messages
1,409
Reaction score
0
Points
0
Location
Boynton Beach
Nice Autopilot!I was using that autopilot from orbiter 2005 before this.
 

Artlav

Aperiodic traveller
Addon Developer
Beta Tester
Joined
Jan 7, 2008
Messages
5,790
Reaction score
780
Points
203
Location
Earth
Website
orbides.org
Preferred Pronouns
she/her

TG626

New member
Joined
Apr 8, 2011
Messages
24
Reaction score
0
Points
1
Location
Earth
Website
www.federalproductions.com
Perhaps in a future version you could make it so that it says "No Solution" when it tries and can't find one? When I first started using it, I thought I was screwing something up until I realized what was actually going on...

(I never got to use RedShift since it was out of date when I started this Orbiter thing, but it sure looked like it was a cool plugin)
 

Artlav

Aperiodic traveller
Addon Developer
Beta Tester
Joined
Jan 7, 2008
Messages
5,790
Reaction score
780
Points
203
Location
Earth
Website
orbides.org
Preferred Pronouns
she/her
Update 0.3.1

Changes:
-Error reporting for failed sequences
-Error reporting on missing target vessel
-Docking AP time accel limit is now 10x
-Fixed docking & O2010P1 issues

-Maneuvre autopilot:
--Types:
---Burn timed
---Burn by DV
--Orientations (Absolute by nose):
---Prograde
---Retrograde
---From target
---Towards target

-Tools autopilot:
--Wait for distance

-Scenarios:
--"Mission-DG around the Moon", Take-off from the Moon, landing back on the same base after a full orbit
--"Maneuvre-There and back", just some moving around for demo
--"Maneuvre-Undock and deorbit", undock and deorbit

The fun here is "Mission-DG around the Moon", where a DG lands onto a base on the Moon, deorbiting is by dead reckoning, landing by guidance.
Full landing autopilot is hopefully coming soon, but that should be somewhat good too.

Maneuvres autopilot allows you to make burns in defined directions and for given duration or Dv.


On a related subject:
Is anyone interested in ability to make autopilots in UAP framework?
For example, here is the code for the new maneuvre autopilot:
Code:
//#######################################################################################//
class ap_maneuvre:public iautopilot{
public:
 ap_maneuvre(VESSEL *vessel);
 void start(); 
 void init();
 void stop();
 void step(double simt,double simdt);
 void info();
                 
 VESSEL *tgt_ves;
 char tgt_nam[255];
 int use_grp,mode,dvdir;
 double dv,dt,level;
 char mode_is[255],dir_is[255];
};
//#######################################################################################//
ap_maneuvre::ap_maneuvre(VESSEL *vessel):iautopilot(vessel)
{
 //Define and initialize variables
 sprintf(name,"Maneuvre\0");
 add_var("engine"     ,VT_INT ,&use_grp,VF_INP,1,15);
 add_var("mode"       ,VT_INT ,&mode   ,VF_INP,0,1);  
 add_var("target"     ,VT_CHAR,tgt_nam ,VF_INP,0,255);
 add_var("orientation",VT_INT ,&dvdir  ,VF_INP,0,3);
 add_var("dv"         ,VT_DBL ,&dv     ,VF_INP,0,1e10);
 add_var("dt"         ,VT_DBL ,&dt     ,VF_INP,0,1e10);
 add_var("level"      ,VT_DBL ,&level  ,VF_INP,0,1);
 add_var("mode_is"    ,VT_CHAR,&mode_is,VF_OUT,0,255);
 add_var("dir_is"     ,VT_CHAR,&dir_is ,VF_OUT,0,255);
          
 sprintf(tgt_nam,"\0");
 use_grp=xTHGROUP_MAIN;
 mode=0;
 dv=100;
 dt=10;
 dvdir=0;
 level=1;
 max_time_accel=10;
 use_grp=xTHGROUP_MAIN;
 info();
}
//#######################################################################################//
void ap_maneuvre::info()
{
 //Process info variables
 switch(mode){
  case 0:set_char_var("mode_is","Timed burn");break;
  case 1:set_char_var("mode_is","Dv burn");break;
  default:set_char_var("mode_is","WTF?");
 }
 switch(dvdir){
  case 0:set_char_var("dir_is","Prograde");break;
  case 1:set_char_var("dir_is","Retrograde");break;
  case 2:set_char_var("dir_is","From target");break;
  case 3:set_char_var("dir_is","Towards target");break;
  default:set_char_var("dir_is","N/A");
 }
}
//#######################################################################################//
void ap_maneuvre::start()
{
 //On start
 iautopilot::start();
 is_started=true;
 is_running=true;
 init();
}      
//#######################################################################################//
void ap_maneuvre::init()
{
 //Before all runs
 is_loaded=true;
 
 stop_all_engines();
 
 tgt_ves=vessel_by_name(tgt_nam);
 if((dvdir==2)||(dvdir==3))if(!tgt_ves){fail_error("No such target vessel");return;}
}
//#######################################################################################//
void ap_maneuvre::stop()
{
 //On finish or stop
 iautopilot::stop();
 stop_all_engines();
}
//#######################################################################################//
void ap_maneuvre::step(double simt,double simdt)
{
 //Every step
 if(!is_running)return; 
 if(!is_loaded)init();
 VECTOR3 ang_vel,pyr,d,rv,rp;                 
 int can_burn=0;
 double acc,lv;    

 ang_vel=get_angular_vel_grp(use_grp);
                      

 sprintf(state_string,"Orienting)");
 if(dvdir==0){
  pyr=get_pitchyawroll(global_2_local(us,get_relative_vel(us,get_gravity_ref(us))+get_global_pos(us)),global_2_local(us,get_relative_pos(us,get_gravity_ref(us))+get_global_pos(us)));
  if((absd(pyr.x-0)<1*RAD)&&(absd(pyr.y-0)<1*RAD)&&(absd(pyr.z-0)<1*RAD)){
   if((absd(ang_vel.x)<0.05)&&(absd(ang_vel.y)<0.05)&&(absd(ang_vel.z)<0.05))can_burn=1;
  }
  att_guide(simdt,0,0,0,1);
  att_control_exp(simdt,pyr.x,pyr.y,pyr.z,0,0,0,7,1);
 }else if(dvdir==1){
  pyr=get_pitchyawroll(-global_2_local(us,get_relative_vel(us,get_gravity_ref(us))+get_global_pos(us)),global_2_local(us,get_relative_pos(us,get_gravity_ref(us))+get_global_pos(us)));
  if((absd(pyr.x-0)<1*RAD)&&(absd(pyr.y-0)<1*RAD)&&(absd(pyr.z-0)<1*RAD)){
   if((absd(ang_vel.x)<0.05)&&(absd(ang_vel.y)<0.05)&&(absd(ang_vel.z)<0.05))can_burn=1;
  }
  att_guide(simdt,0,0,0,1);
  att_control_exp(simdt,pyr.x,pyr.y,pyr.z,0,0,0,7,1);
 }else if((dvdir==2)||(dvdir==3)){   
  rv=get_obj_relative_vel(get_ves_obj(us),get_ves_obj(tgt_ves));
  rp=get_obj_relative_pos(get_ves_obj(us),get_ves_obj(tgt_ves));
  d=global_2_local(us,rp+get_global_pos(us));
  if(dvdir==3)d=-d;
  pyr=get_pitchyawroll(d,tvec(0,0,0));
  if((absd(pyr.x-0)<1*RAD)&&(absd(pyr.y-0)<1*RAD)&&(absd(pyr.z-0)<1*RAD)){
   if((absd(ang_vel.x)<0.05)&&(absd(ang_vel.y)<0.05)&&(absd(ang_vel.z)<0.05))can_burn=1;
  }
  att_guide(simdt,0,0,0,1);
  att_control_exp(simdt,pyr.x,pyr.y,0,0,0,0,7,1);
 }

 if(can_burn){  
  sprintf(state_string,"Burning");
  if(mode==0){  
   dt=dt-simdt; 
   if(dt<=0){stop();return;}  
   set_thgrp_level(level,use_grp);
  }else if(mode==1){      
   if(dv<=0){stop();return;}  
   acc=modv(get_group_thrust_vector(use_grp,true))/get_ves_mass(us);
   if(level*acc*simdt>dv)lv=dv/simdt;else lv=level*acc;
   dv=dv-lv*simdt;    
   set_thgrp_level(lv/acc,use_grp);
  }
 }else set_thgrp_level(0,use_grp);
}

Advantages are that your code would be within a common framework for sequencing and state saving, along with a refined and portable interface to Orbiter.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,295
Reaction score
3,266
Points
203
Location
Toulouse
That could be a step forward towards AI-controlled vessels... :hmm:
 

Spacethingy

Multitasker
Joined
Sep 9, 2010
Messages
1,515
Reaction score
0
Points
36
Location
Not the anti-matter universe
Website
spacethingy.weebly.com
I tested it to destruction with the infamous rotating Luna-OB1:
She passed with flying colours, more than I can say for the DGIV's docking AP! :thumbup:

Just one thing about the docking AP, I think that the docking numbers are out of sync: :huh:
For instance, dock port 1 become 0. If you want to dock with/use dock port 2, you have to enter 1.

It's only a minor thing though.:tiphat:
 
Top