SHOW:
|
|
- or go back to the newest paste.
1 | set sl to 1. | |
2 | lock steering to heading(90,90). | |
3 | - | set taltpid to pidloop(10, 0.7, 1.5, 100, 360). |
3 | + | set tgt to ship:geoposition. |
4 | lock tv to tgt:position:normalized * min(10,(tgt:distance/6) ^ 0.85). | |
5 | - | set steeringmanager:pitchtorquefactor to 0.2. |
5 | + | lock steering to heading(90,90). |
6 | - | set steeringmanager:yawtorquefactor to 0.5. |
6 | + | set talt to 100. |
7 | - | set steeringmanager:rollcontrolanglerange to 180. |
7 | + | set taltpid to pidloop(4, 1, 2, 0, 460). |
8 | ||
9 | - | steeringmanager:resetpids(). |
9 | + | |
10 | - | lock x to 90. |
10 | + | |
11 | - | set p to 0. |
11 | + | |
12 | - | set a to 2. |
12 | + | |
13 | - | set talt to 300. |
13 | + | |
14 | - | lock steering to heading(x,p). |
14 | + | |
15 | ||
16 | for rotor in rotors rotor:getmodulebyindex(1):setfield("torque limit(%)",100). | |
17 | set taltpid:setpoint to talt. | |
18 | on talt {set taltpid:setpoint to talt. return true. } | |
19 | ||
20 | - | lock tilt to 0. |
20 | + | |
21 | ||
22 | set adjust to true. | |
23 | when true then { | |
24 | For b in blades b:getmodule("ModuleControlSurface"):setfield("deploy angle",deploy). | |
25 | for rotor in rotors rotor:getmodulebyindex(1):setfield("rpm limit",rpmlimit). | |
26 | - | when alt:radar > 100 then { set tilt to 20. lock x to allwaypoints()[2]:geoposition:heading - 90. } |
26 | + | set relVelVec to vxcl(up:vector, tv - velocity:surface) / 3.5. |
27 | set relVelVec:mag to min(sl,relVelVec:mag). | |
28 | lock steering to lookdirup(up:vector * 10 + relVelVec, facing:topvector). | |
29 | return adjust. | |
30 | } | |
31 | - | For s in servos s:getmodule("ModuleRoboticRotationServo"):setfield("target angle",tilt). |
31 | + | |
32 |