Skip to content

Commit 7efe807

Browse files
author
Patrick Bechon
committed
Update vesselPointing, maneuver and target structs to include heading and pitch information
1 parent f28e74b commit 7efe807

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/KerbalSimpitMessageTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ enum OutboundPackets
116116
/** Data about the current orbit.
117117
Messages on this channel contain an orbitInfoMessage. */
118118
ORBIT_MESSAGE = 36,
119-
/** Data about the vessel's rotation. This is an output, not be confused with rotationMessage, an input from joysticks.
119+
/** Data about the vessel's rotation (including velocities). This is an output, not be confused with rotationMessage, an input from joysticks.
120120
Messages on this channel contain an vesselPointingMessage. */
121121
ROTATION_DATA = 45,
122122

src/PayloadStructs.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ struct velocityMessage {
139139
struct targetMessage {
140140
float distance; /**< Distance to target. */
141141
float velocity; /**< Velocity relative to target. */
142+
float heading; /**< Heading of the target. */
143+
float pitch; /**< Pitch of the target. */
144+
float velocityHeading; /**< Heading of the velocity to the target. */
145+
float velocityPitch; /**< Pitch of the velocity to the target. */
142146
} __attribute__((packed));
143147

144148
/** An Airspeed information message. */
@@ -153,16 +157,19 @@ struct maneuverMessage {
153157
float deltaVNextManeuver; /**< Delta to the next planned maneuver. */
154158
float durationNextManeuver; /**< Duration of the burn for the next planned maneuver. */
155159
float deltaVTotal; /**< DeltaV of all the planned maneuvers. */
156-
float x; /**< X rotation of maneuver node relative to worldspace */
157-
float y; /**< Y rotation of maneuver node relative to worldspace */
158-
float z; /**< Z rotation of maneuver node relative to worldspace */
160+
float headingNextManeuver; /**< Heading of the next maneuver. */
161+
float pitchNextManeuver; /**< Pitch of the next maneuver. */
159162
} __attribute__((packed));
160163

161-
/** A vessel rotation information message. */
164+
/** A vessel orientation information message, including velocity orientation. */
162165
struct vesselPointingMessage {
163-
float x; /**< X rotation of vessel relative to worldspace */
164-
float y; /**< Y rotation of vessel relative to worldspace */
165-
float z; /**< Z rotation of vessel relative to worldspace */
166+
float heading; /**< Heading of the vessel (between 0 and 360, as indicated in the navball. 90 when pointing east, 180 when pointing south).*/
167+
float pitch; /**< Pitch angle of the vessel (between -90 and +90. 0 for an horizontal craft, +90 when pointing up, -90 when pointing down). */
168+
float roll; /**< Roll angle of the vessel (between -180 and +180. 0 for a plane on the runway, ready to takeoff). */
169+
float orbitalVelocityHeading; /**< Heading of the orbital velocity. */
170+
float orbitalVelocityPitch; /**< Pitch of the orbital velocity. */
171+
float surfaceVelocityHeading; /**< Heading of the surface velocity. */
172+
float surfaceVelocityPitch; /**< Pitch of the surface velocity. */
166173
} __attribute__((packed));
167174

168175
/** A deltaV information message. */
@@ -191,7 +198,7 @@ struct tempLimitMessage {
191198
byte skinTempLimitPercentage; /**< Maximum temperature percentage (as current skin temp over max skin temp) of any part of the vessel. */
192199
} __attribute__((packed));
193200

194-
/** A vessel rotation message.
201+
/** A vessel rotation message, only used to send commands to KSP.
195202
This struct contains information about vessel rotation commands. */
196203
struct rotationMessage {
197204
int16_t pitch; /**< Vessel pitch. */

0 commit comments

Comments
 (0)