Skip to content

Commit 698a5f8

Browse files
committed
Added Python descriptions for using set/get config messages.
1 parent 3930254 commit 698a5f8

2 files changed

Lines changed: 59 additions & 9 deletions

File tree

python/examples/send_command.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868
# protocol=ProtocolType.FUSION_ENGINE,
6969
# message_id=MessageType.POSE,
7070
# rate=MessageRate.ON_CHANGE)
71-
# message = SetConfigMessage(InterfaceDirectionConfig(TransportDirection.SERVER),
71+
# message = SetConfigMessage(InterfaceDiagnosticMessagesEnabled(True),
72+
# interface=InterfaceID(TransportType.TCP, 0))
73+
# message = GetConfigMessage(InterfaceDiagnosticMessagesEnabled,
7274
# interface=InterfaceID(TransportType.TCP, 0))
7375
# message = FaultControlMessage(payload=FaultControlMessage.EnableGNSS(False))
7476

python/fusion_engine_client/messages/configuration.py

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,35 @@ class Empty(NamedTuple):
764764
_conf_gen = _ConfigClassGenerator()
765765

766766

767+
########################################################################################################################
768+
# Device configuration settings (lever arms, orientation, wheel speed settings, etc.).
769+
#
770+
# The classes below may be passed to a SetConfigMessage or returned by a ConfigResponseMessage using the `config_object`
771+
# field. For example:
772+
# ```
773+
# SetConfigMessage(GNSSLeverArmConfig(0.4, 0.0, 1.2))
774+
# SetConfigMessage(EnabledGNSSSystemsConfig(SatelliteType.GPS, SatelliteType.GALILEO))
775+
#
776+
# GetConfigMessage(GNSSLeverArmConfig)
777+
# config_response.config_object.x == 0.4
778+
# ```
779+
#
780+
# Note that many of these configuration classes share common parameters, and their fields are defined by their specified
781+
# base classes. For example, `GNSSLeverArmConfig` inherits from `Point3F` and contains `x`, `y`, and `z` fields as
782+
# follows:
783+
# ```
784+
# class Point3F(NamedTuple):
785+
# """!
786+
# @brief 3D coordinate specifier, stored as 32-bit float values.
787+
# """
788+
# x: float = math.nan
789+
# y: float = math.nan
790+
# z: float = math.nan
791+
# class GNSSLeverArmConfig(_conf_gen.Point3F): ...
792+
# ```
793+
########################################################################################################################
794+
795+
767796
@_conf_gen.create_config_class(ConfigType.DEVICE_LEVER_ARM, _conf_gen.Point3FConstruct)
768797
class DeviceLeverArmConfig(_conf_gen.Point3F):
769798
"""!
@@ -957,6 +986,33 @@ class HeadingBias(_conf_gen.HeadingBias):
957986
pass
958987

959988

989+
@_conf_gen.create_config_class(ConfigType.INVALID, _conf_gen.EmptyConstruct)
990+
class InvalidConfig(_conf_gen.Empty):
991+
"""!
992+
@brief Placeholder for empty invalid configuration messages.
993+
"""
994+
pass
995+
996+
997+
########################################################################################################################
998+
# Input/output interface controls.
999+
#
1000+
# When configuring I/O interfaces, you must specify the desired interface:
1001+
#
1002+
# Examples:
1003+
# ```
1004+
# SetConfigMessage(
1005+
# InterfaceDiagnosticMessagesEnabled(True),
1006+
# interface=InterfaceID(TransportType.TCP, 0))
1007+
#
1008+
# GetConfigMessage(
1009+
# InterfaceDiagnosticMessagesEnabled,
1010+
# interface=InterfaceID(TransportType.TCP, 0))
1011+
# config_response.config_object.value == True
1012+
# ```
1013+
########################################################################################################################
1014+
1015+
9601016
@_conf_gen.create_interface_config_class(InterfaceConfigType.BAUD_RATE, _conf_gen.UInt32Construct)
9611017
class InterfaceBaudRateConfig(_conf_gen.IntegerVal):
9621018
"""!
@@ -1013,14 +1069,6 @@ class InterfaceDiagnosticMessagesEnabled(_conf_gen.BoolVal):
10131069
pass
10141070

10151071

1016-
@_conf_gen.create_config_class(ConfigType.INVALID, _conf_gen.EmptyConstruct)
1017-
class InvalidConfig(_conf_gen.Empty):
1018-
"""!
1019-
@brief Placeholder for empty invalid configuration messages.
1020-
"""
1021-
pass
1022-
1023-
10241072
class InterfaceConfigSubmessage(NamedTuple):
10251073
interface: InterfaceID = InterfaceID()
10261074
subtype: InterfaceConfigType = InterfaceConfigType.INVALID

0 commit comments

Comments
 (0)