Skip to content

Commit

Permalink
Renamed GNSSHeadingOutput -> GNSSAttitudeOutput.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamshapiro0 committed Dec 2, 2024
1 parent 702ebd0 commit 29df295
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 52 deletions.
24 changes: 12 additions & 12 deletions python/fusion_engine_client/analysis/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1943,24 +1943,24 @@ def _plot_imu_data(self, message_cls, filename, figure_title):

self._add_figure(name=filename, figure=figure, title=figure_title)

def plot_gnss_heading_measurements(self):
def plot_gnss_attitude_measurements(self):
"""!
@brief Generate time series plots for GNSS heading (degrees) and baseline distance (meters) data.
@brief Generate time series plots for GNSS attitude (degrees) and baseline distance (meters) data.
"""
if self.output_dir is None:
return

# Read the heading measurement data.
result = self.reader.read(message_types=[RawGNSSHeadingOutput, GNSSHeadingOutput], **self.params)
raw_heading_data = result[RawGNSSHeadingOutput.MESSAGE_TYPE]
heading_data = result[GNSSHeadingOutput.MESSAGE_TYPE]
# Read the attitude measurement data.
result = self.reader.read(message_types=[RawGNSSAttitudeOutput, GNSSAttitudeOutput], **self.params)
raw_heading_data = result[RawGNSSAttitudeOutput.MESSAGE_TYPE]
heading_data = result[GNSSAttitudeOutput.MESSAGE_TYPE]

if (len(heading_data.p1_time) == 0) and (len(raw_heading_data.p1_time) == 0):
self.logger.info('No GNSS heading measurement data available. Skipping plot.')
self.logger.info('No GNSS attitude measurement data available. Skipping plot.')
return

# Note that we read the pose data after heading, that way we don't bother reading pose data from disk if there's
# no heading data in the log.
# Note that we read the pose data after attitude, that way we don't bother reading pose data from disk if
# there's no heading data in the log.
result = self.reader.read(message_types=[PoseMessage], source_ids=self.default_source_id, **self.params)
primary_pose_data = result[PoseMessage.MESSAGE_TYPE]

Expand Down Expand Up @@ -2187,7 +2187,7 @@ def plot_gnss_heading_measurements(self):
row=3, col=1
)

self._add_figure(name='gnss_heading_measurement', figure=fig, title='Measurements: GNSS Heading')
self._add_figure(name='gnss_attitude_measurement', figure=fig, title='Measurements: GNSS Attitude')

def plot_system_status_profiling(self):
"""!
Expand Down Expand Up @@ -3001,9 +3001,9 @@ def main(args=None):
analyzer.plot_gnss_corrections_status()
analyzer.plot_dop()

# By default, we always plot heading measurements (i.e., output from a secondary heading device like an
# By default, we always plot attitude measurements (i.e., output from a secondary GNSS attitude sensor like an
# LG69T-AH), separate from other sensor measurements controlled by --measurements.
analyzer.plot_gnss_heading_measurements()
analyzer.plot_gnss_attitude_measurements()

if truth_lla_deg is not None:
analyzer.plot_stationary_position_error(truth_lla_deg)
Expand Down
4 changes: 2 additions & 2 deletions python/fusion_engine_client/messages/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ class MessageType(IntEnum):

# Sensor measurement messages.
IMU_OUTPUT = 11000
RAW_GNSS_HEADING_OUTPUT = 11001
RAW_GNSS_ATTITUDE_OUTPUT = 11001
RAW_IMU_OUTPUT = 11002
GNSS_HEADING_OUTPUT = 11003
GNSS_ATTITUDE_OUTPUT = 11003
IMU_INPUT = 11004

# Vehicle measurement messages.
Expand Down
22 changes: 11 additions & 11 deletions python/fusion_engine_client/messages/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,11 +1169,11 @@ def to_numpy(cls, messages):
################################################################################


class GNSSHeadingOutput(MessagePayload):
class GNSSAttitudeOutput(MessagePayload):
"""!
@brief Multi-antenna GNSS heading sensor measurement output with offset corrections applied.
@brief Multi-antenna GNSS attitude sensor measurement output with offset corrections applied.
"""
MESSAGE_TYPE = MessageType.GNSS_HEADING_OUTPUT
MESSAGE_TYPE = MessageType.GNSS_ATTITUDE_OUTPUT
MESSAGE_VERSION = 0

_STRUCT = struct.Struct('<B3xL3ff')
Expand Down Expand Up @@ -1249,7 +1249,7 @@ def __repr__(self):

def __str__(self):
return f"""\
GNSS Heading Output @ {str(self.details.p1_time)}
GNSS Attitude Output @ {str(self.details.p1_time)}
Solution Type: {self.solution_type}
YPR (ENU) (deg): {self.ypr_deg[0]:.2f}, {self.ypr_deg[1]:.2f}, {self.ypr_deg[2]:.2f}
Heading (deg): {self.heading_true_north_deg:.2f}"""
Expand All @@ -1259,7 +1259,7 @@ def calcsize(cls) -> int:
return cls._STRUCT.size + MeasurementDetails.calcsize()

@classmethod
def to_numpy(cls, messages: Sequence['GNSSHeadingOutput']):
def to_numpy(cls, messages: Sequence['GNSSAttitudeOutput']):
result = {
'solution_type': np.array([int(m.solution_type) for m in messages], dtype=int),
'flags': np.array([int(m.flags) for m in messages], dtype=np.uint32),
Expand All @@ -1270,11 +1270,11 @@ def to_numpy(cls, messages: Sequence['GNSSHeadingOutput']):
return result


class RawGNSSHeadingOutput(MessagePayload):
class RawGNSSAttitudeOutput(MessagePayload):
"""!
@brief Raw (uncorrected) GNSS heading sensor measurement output.
@brief Raw (uncorrected) GNSS attitude sensor measurement output.
"""
MESSAGE_TYPE = MessageType.RAW_GNSS_HEADING_OUTPUT
MESSAGE_TYPE = MessageType.RAW_GNSS_ATTITUDE_OUTPUT
MESSAGE_VERSION = 0

_STRUCT = struct.Struct('<B3xL3f3fff')
Expand All @@ -1283,7 +1283,7 @@ def __init__(self):
## Measurement timestamps, if available. See @ref measurement_messages.
self.details = MeasurementDetails()

## Set to @ref SolutionType::RTKFixed when heading is available, or @ref SolutionType::Invalid otherwise.
## Set to @ref SolutionType::RTKFixed when attitude is available, or @ref SolutionType::Invalid otherwise.
self.solution_type = SolutionType.Invalid
## A bitmask of flags associated with the solution.
self.flags = 0
Expand Down Expand Up @@ -1367,7 +1367,7 @@ def __repr__(self):

def __str__(self):
return f"""\
Raw GNSS Heading Output @ {str(self.details.p1_time)}
Raw GNSS Attitude Output @ {str(self.details.p1_time)}
Solution Type: {self.solution_type}
Relative position (ENU) (m): {self.relative_position_enu_m[0]:.2f}, {self.relative_position_enu_m[1]:.2f}, {self.relative_position_enu_m[2]:.2f}
Position std (ENU) (m): {self.position_std_enu_m[0]:.2f}, {self.position_std_enu_m[1]:.2f}, {self.position_std_enu_m[2]:.2f}
Expand All @@ -1379,7 +1379,7 @@ def calcsize(cls) -> int:
return cls._STRUCT.size + MeasurementDetails.calcsize()

@classmethod
def to_numpy(cls, messages: Sequence['RawGNSSHeadingOutput']):
def to_numpy(cls, messages: Sequence['RawGNSSAttitudeOutput']):
result = {
'solution_type': np.array([int(m.solution_type) for m in messages], dtype=int),
'flags': np.array([int(m.flags) for m in messages], dtype=np.uint32),
Expand Down
2 changes: 1 addition & 1 deletion python/fusion_engine_client/messages/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ class RelativeENUPositionMessage(MessagePayload):
This message represents the relationship between the navigation engine's
position solution and a nearby RTK base station. It is not used to convey
unfiltered vehicle body orientation measurements generated using multiple
GNSS antennas. See @ref GNSSHeadingOutput instead.
GNSS antennas. See @ref GNSSAttitudeOutput instead.
"""
MESSAGE_TYPE = MessageType.RELATIVE_ENU_POSITION
MESSAGE_VERSION = 0
Expand Down
2 changes: 1 addition & 1 deletion src/point_one/fusion_engine/messages/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ struct P1_ALIGNAS(4) HardwareTickConfig {
* If one value is NOT set, the system will not output the corrected
* heading message.
*
* @ref GNSSHeadingOutput
* @ref GNSSAttitudeOutput
*/
struct P1_ALIGNAS(4) HeadingBias {
/**
Expand Down
17 changes: 9 additions & 8 deletions src/point_one/fusion_engine/messages/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ enum class MessageType : uint16_t {

// Sensor measurement messages.
IMU_OUTPUT = 11000, ///< @ref IMUOutput
RAW_GNSS_HEADING_OUTPUT = 11001, ///< @ref RawGNSSHeadingOutput
RAW_GNSS_ATTITUDE_OUTPUT = 11001, ///< @ref RawGNSSAttitudeOutput
RAW_IMU_OUTPUT = 11002, ///< @ref RawIMUOutput
GNSS_HEADING_OUTPUT = 11003, ///< @ref GNSSHeadingOutput
// TODO Change the numbers
GNSS_ATTITUDE_OUTPUT = 11003, ///< @ref GNSSAttitudeOutput
IMU_INPUT = 11004, ///< @ref IMUInput

// Vehicle measurement messages.
Expand Down Expand Up @@ -151,14 +152,14 @@ P1_CONSTEXPR_FUNC const char* to_string(MessageType type) {
case MessageType::IMU_OUTPUT:
return "IMU Output";

case MessageType::RAW_GNSS_HEADING_OUTPUT:
return "Raw GNSS Heading Output";
case MessageType::RAW_GNSS_ATTITUDE_OUTPUT:
return "Raw GNSS Attitude Output";

case MessageType::RAW_IMU_OUTPUT:
return "Raw IMU Output";

case MessageType::GNSS_HEADING_OUTPUT:
return "GNSS Heading Output";
case MessageType::GNSS_ATTITUDE_OUTPUT:
return "GNSS Attitude Output";

case MessageType::IMU_INPUT:
return "IMU Input";
Expand Down Expand Up @@ -330,9 +331,9 @@ P1_CONSTEXPR_FUNC bool IsCommand(MessageType message_type) {
case MessageType::RELATIVE_ENU_POSITION:
case MessageType::SYSTEM_STATUS:
case MessageType::IMU_OUTPUT:
case MessageType::RAW_GNSS_HEADING_OUTPUT:
case MessageType::RAW_GNSS_ATTITUDE_OUTPUT:
case MessageType::RAW_IMU_OUTPUT:
case MessageType::GNSS_HEADING_OUTPUT:
case MessageType::GNSS_ATTITUDE_OUTPUT:
case MessageType::IMU_INPUT:
case MessageType::DEPRECATED_WHEEL_SPEED_MEASUREMENT:
case MessageType::DEPRECATED_VEHICLE_SPEED_MEASUREMENT:
Expand Down
32 changes: 16 additions & 16 deletions src/point_one/fusion_engine/messages/measurements.h
Original file line number Diff line number Diff line change
Expand Up @@ -1134,20 +1134,20 @@ struct P1_ALIGNAS(4) DeprecatedVehicleSpeedMeasurement : public MessagePayload {
};

////////////////////////////////////////////////////////////////////////////////
// Heading Sensor Definitions
// Attitude Sensor Definitions
////////////////////////////////////////////////////////////////////////////////

/**
* @brief Multi-antenna GNSS heading sensor measurement output with offset
* corrections applied (@ref MessageType::GNSS_HEADING_OUTPUT, version
* @brief Multi-antenna GNSS attitude sensor measurement output with offset
* corrections applied (@ref MessageType::GNSS_ATTITUDE_OUTPUT, version
* 1.0).
* @ingroup measurement_messages
*
* This message is an output from the device contaning heading/orientation
* measurements generated using multiple GNSS antennas/receivers. On supported
* devices, the device will measure vehicle yaw (heading) and pitch based on the
* relative positions of two GNSS antennas. When more than two antennas are
* present, the device may additionally measure roll angle.
* This message is an output from the device contaning orientation measurements
* generated using multiple GNSS antennas/receivers. On supported devices, the
* device will measure vehicle yaw (heading) and pitch based on the relative
* positions of two GNSS antennas. When more than two antennas are present, the
* device may additionally measure roll angle.
*
* @note
* This message contains vehicle body angle measurements generated from GNSS
Expand All @@ -1157,10 +1157,10 @@ struct P1_ALIGNAS(4) DeprecatedVehicleSpeedMeasurement : public MessagePayload {
*
* The measurements in this message have user-specified corrections applied for
* the horizontal and vertical offsets between the two GNSS antennas. See also
* @ref RawGNSSHeadingOutput.
* @ref RawGNSSAttitudeOutput.
*/
struct P1_ALIGNAS(4) GNSSHeadingOutput : public MessagePayload {
static constexpr MessageType MESSAGE_TYPE = MessageType::GNSS_HEADING_OUTPUT;
struct P1_ALIGNAS(4) GNSSAttitudeOutput : public MessagePayload {
static constexpr MessageType MESSAGE_TYPE = MessageType::GNSS_ATTITUDE_OUTPUT;
static constexpr uint8_t MESSAGE_VERSION = 0;

/**
Expand Down Expand Up @@ -1205,8 +1205,8 @@ struct P1_ALIGNAS(4) GNSSHeadingOutput : public MessagePayload {
};

/**
* @brief Raw (uncorrected) GNSS heading sensor measurement output (@ref
* MessageType::RAW_GNSS_HEADING_OUTPUT, version 1.0).
* @brief Raw (uncorrected) GNSS attitude sensor measurement output (@ref
* MessageType::RAW_GNSS_ATTITUDE_OUTPUT, version 1.0).
* @ingroup measurement_messages
*
* This message is an output from the device contaning raw orientation
Expand All @@ -1216,11 +1216,11 @@ struct P1_ALIGNAS(4) GNSSHeadingOutput : public MessagePayload {
* secondary GNSS antenna.
*
* For vehicle body angle measurements, and for measurements corrected for
* horizontal/vertical offsets, see @ref GNSSHeadingOutput.
* horizontal/vertical offsets, see @ref GNSSAttitudeOutput.
*/
struct P1_ALIGNAS(4) RawGNSSHeadingOutput : public MessagePayload {
struct P1_ALIGNAS(4) RawGNSSAttitudeOutput : public MessagePayload {
static constexpr MessageType MESSAGE_TYPE =
MessageType::RAW_GNSS_HEADING_OUTPUT;
MessageType::RAW_GNSS_ATTITUDE_OUTPUT;
static constexpr uint8_t MESSAGE_VERSION = 0;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/point_one/fusion_engine/messages/solution.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ struct P1_ALIGNAS(4) CalibrationStatusMessage : public MessagePayload {
* This message represents the relationship between the navigation engine's
* position solution and a nearby RTK base station. It is not used to convey
* unfiltered vehicle body orientation measurements generated using multiple
* GNSS antennas. See @ref GNSSHeadingOutput instead.
* GNSS antennas. See @ref GNSSAttitudeOutput instead.
*/
struct P1_ALIGNAS(4) RelativeENUPositionMessage : public MessagePayload {
static constexpr MessageType MESSAGE_TYPE =
Expand Down

0 comments on commit 29df295

Please sign in to comment.