SITL: Sim_Ship: label global_position_int and attitude packet fields
This commit is contained in:
parent
28488cbfd6
commit
b30bdb7dd3
@ -210,15 +210,15 @@ void ShipSim::send_report(void)
|
||||
vel.rotate(radians(ship.heading_deg));
|
||||
|
||||
const mavlink_global_position_int_t global_position_int{
|
||||
now,
|
||||
loc.lat,
|
||||
loc.lng,
|
||||
alt_mm,
|
||||
0,
|
||||
int16_t(vel.x*100),
|
||||
int16_t(vel.y*100),
|
||||
0,
|
||||
uint16_t(ship.heading_deg*100)
|
||||
time_boot_ms: now,
|
||||
lat: loc.lat,
|
||||
lon: loc.lng,
|
||||
alt: alt_mm,
|
||||
relative_alt: 0,
|
||||
vx: int16_t(vel.x*100),
|
||||
vy: int16_t(vel.y*100),
|
||||
vz: 0,
|
||||
hdg: uint16_t(ship.heading_deg*100)
|
||||
};
|
||||
mavlink_message_t msg;
|
||||
mavlink_msg_global_position_int_encode_status(
|
||||
@ -236,9 +236,13 @@ void ShipSim::send_report(void)
|
||||
|
||||
{ // also set ATTITUDE so MissionPlanner can display ship orientation
|
||||
const mavlink_attitude_t attitude{
|
||||
now,
|
||||
0, 0, float(radians(ship.heading_deg)),
|
||||
0, 0, ship.yaw_rate
|
||||
time_boot_ms: now,
|
||||
roll: 0,
|
||||
pitch: 0,
|
||||
yaw: float(radians(ship.heading_deg)),
|
||||
rollspeed: 0,
|
||||
pitchspeed: 0,
|
||||
yawspeed: ship.yaw_rate
|
||||
};
|
||||
mavlink_message_t msg;
|
||||
mavlink_msg_attitude_encode_status(
|
||||
|
Loading…
Reference in New Issue
Block a user