Service#

class Trajectories : public krpc::RemoteService#

Provides functionality to interact with Trajectories.

Note

Trajectories predicts the trajectory of the active vessel only.

Trajectories(krpc::Connection &connection)#

Construct an instance of this service.

bool available()#

Whether Trajectories is available.

std::optional<Patch> impact_patch()#

The patch of the trajectory that ends in an impact.

Returns:

The patch, or NULL without an impact.

Game Scenes:

Flight

std::optional<std::tuple<double, double, double>> impact_position(SpaceCenter::ReferenceFrame reference_frame)#

The position of the impact, or NULL without one.

Parameters:
  • reference_frame – The reference frame for the position.

Game Scenes:

Flight

Note

In a reference frame that rotates with the body, the position includes the rotation of the body until the impact.

std::optional<std::tuple<double, double, double>> impact_velocity(SpaceCenter::ReferenceFrame reference_frame)#

The velocity at the impact, or NULL without one.

Parameters:
  • reference_frame – The reference frame for the velocity.

Game Scenes:

Flight

Note

In a reference frame that rotates with the body, the velocity includes the rotation of the body until the impact.

std::vector<Patch> patches()#

The patches of the trajectory.

Game Scenes:

Flight

std::optional<std::tuple<double, double, double>> planned_direction(SpaceCenter::ReferenceFrame reference_frame)#

The direction that the descent profile sets for the vessel.

Parameters:
  • reference_frame – The reference frame for the direction.

Returns:

The direction, or NULL without a target.

Game Scenes:

Flight

std::optional<std::tuple<double, double, double>> corrected_direction(SpaceCenter::ReferenceFrame reference_frame)#

The planned_direction(), corrected to steer towards the target.

Parameters:
  • reference_frame – The reference frame for the direction.

Returns:

The direction, or NULL without a target.

Game Scenes:

Flight

Note

Suitable as the target direction of the auto-pilot.

void set_target(SpaceCenter::ReferenceFrame reference_frame, std::tuple<double, double, double> position, std::optional<SpaceCenter::CelestialBody> body = std::optional<SpaceCenter::CelestialBody>())#

Sets the target.

Parameters:
  • reference_frame – The reference frame for the position.

  • position – The position of the target.

  • body – The body of the target, by default the body the active vessel orbits.

Game Scenes:

Flight

std::optional<SpaceCenter::CelestialBody> target_body()#

The body of the target, or NULL without a target.

Game Scenes:

Flight

std::optional<std::tuple<double, double, double>> target_position(SpaceCenter::ReferenceFrame reference_frame)#

The position of the target, or NULL without a target.

Parameters:
  • reference_frame – The reference frame for the position.

Game Scenes:

Flight

void clear_target()#

Clears the target.

Game Scenes:

Flight

DescentProfile descent_profile()#

The descent profile.

Game Scenes:

Flight

bool always_update()#
void set_always_update(bool value)#

Whether Trajectories updates the trajectory continuously.

Game Scenes:

Flight

Note

When false, update_trajectory() updates the trajectory.

void update_trajectory()#

Updates the trajectory.

Game Scenes:

Flight