std::control::steering
Types
SteeringControl
Helper to use SteeringController
with a SteeringManager
of a vessel.
Use the control_steering
function to set it up correctly.
Fields
Name |
Type |
Read-only |
Description |
---|---|---|---|
controller |
R/W |
||
manager |
R/W |
Methods
release
steeringcontrol.release ( ) -> Unit
resume
steeringcontrol.resume ( ) -> Unit
set_direction
steeringcontrol.set_direction ( dir : ksp::math::Direction ) -> Unit
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
dir |
ksp::math::Direction |
set_global_direction
steeringcontrol.set_global_direction ( dir : ksp::math::GlobalDirection ) -> Unit
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
dir |
ksp::math::GlobalDirection |
set_heading
steeringcontrol.set_heading ( degrees_from_north : float,
pitch_above_horizon : float,
roll : float ) -> Unit
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
degrees_from_north |
float |
||
pitch_above_horizon |
float |
||
roll |
float |
SteeringController
Fields
Name |
Type |
Read-only |
Description |
---|---|---|---|
acc_pitch |
float |
R/W |
|
acc_roll |
float |
R/W |
|
acc_yaw |
float |
R/W |
|
adjust_torque |
R/W |
||
angular_acceleration |
R/W |
||
center_of_mass |
R/W |
||
control_torque |
R/W |
||
current_rot |
R/W |
||
enable_torque_adjust |
bool |
R/W |
|
max_pitch_omega |
float |
R/W |
|
max_roll_omega |
float |
R/W |
|
max_stopping_time |
float |
R/W |
|
max_yaw_omega |
float |
R/W |
|
measured_torque |
R/W |
||
moment_of_inertia |
R/W |
||
omega |
R/W |
||
phi |
float |
R/W |
|
phi_pitch |
float |
R/W |
|
phi_roll |
float |
R/W |
|
phi_yaw |
float |
R/W |
|
pitch_pi |
R/W |
||
pitch_rate_pi |
R/W |
||
pitch_torque_adjust |
float |
R/W |
|
pitch_torque_calc |
R/W |
||
pitch_torque_factor |
float |
R/W |
|
raw_torque |
R/W |
||
roll_control_angle_range |
float |
R/W |
|
roll_pi |
R/W |
||
roll_rate_pi |
R/W |
||
roll_torque_adjust |
float |
R/W |
|
roll_torque_calc |
R/W |
||
roll_torque_factor |
float |
R/W |
|
target_direction |
R/W |
||
target_rot |
R/W |
||
tgt_pitch_omega |
float |
R/W |
|
tgt_pitch_torque |
float |
R/W |
|
tgt_roll_omega |
float |
R/W |
|
tgt_roll_torque |
float |
R/W |
|
tgt_yaw_omega |
float |
R/W |
|
tgt_yaw_torque |
float |
R/W |
|
vessel |
R/W |
||
yaw_pi |
R/W |
||
yaw_rate_pi |
R/W |
||
yaw_torque_adjust |
float |
R/W |
|
yaw_torque_calc |
R/W |
||
yaw_torque_factor |
float |
R/W |
Methods
print_debug
steeringcontroller.print_debug ( ) -> Unit
reset_i
steeringcontroller.reset_i ( ) -> Unit
update
steeringcontroller.update ( delta_t : float ) -> ksp::math::Vec3
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
delta_t |
float |
update_control
steeringcontroller.update_control ( ) -> ksp::math::Vec3
update_prediction_pi
steeringcontroller.update_prediction_pi ( delta_t : float ) -> Unit
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
delta_t |
float |
update_state_vectors
steeringcontroller.update_state_vectors ( delta_t : float ) -> Unit
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
delta_t |
float |
update_torque
steeringcontroller.update_torque ( ) -> Unit
Functions
SteeringControl
pub sync fn SteeringControl ( manager : ksp::control::SteeringManager,
controller : std::control::steering::SteeringController ) -> std::control::steering::SteeringControl
Helper to use SteeringController
with a SteeringManager
of a vessel.
Use the control_steering
function to set it up correctly.
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
manager |
ksp::control::SteeringManager |
||
controller |
std::control::steering::SteeringController |
SteeringController
pub sync fn SteeringController ( vessel : ksp::vessel::Vessel,
target_direction : ksp::math::GlobalDirection ) -> std::control::steering::SteeringController
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
vessel |
ksp::vessel::Vessel |
||
target_direction |
ksp::math::GlobalDirection |
control_steering
pub fn control_steering ( vessel : ksp::vessel::Vessel ) -> std::control::steering::SteeringControl
Control the steering of a vessel. Example usage:
use { control_steering } from std::control::steering
...
const control = control_steering(vessel)
// vessel is now controlled and will keep its current rotation
control.set_heading(30, 10, 5) // change the desired rotation
sleep(5) // Give the controller time to steer the vessel
...
control.release() // release control of the vessel
Parameters
Name |
Type |
Optional |
Description |
---|---|---|---|
vessel |
ksp::vessel::Vessel |