NaviGator Software Reference¶
Below is the software reference for Navigator-specific systems.
Services¶
MessageDetectDock¶
- class navigator_msgs.srv.MessageDetectDockRequest¶
The request class for the
navigator_msgs/MessageDetectDock
service.
MessageEntranceExitGate¶
- class navigator_msgs.srv.MessageEntranceExitGateRequest¶
The request class for the
navigator_msgs/MessageEntranceExitGate
service.
MessageFindFling¶
- class navigator_msgs.srv.MessageFindFlingRequest¶
The request class for the
navigator_msgs/MessageFindFling
service.
MessageFollowPath¶
- class navigator_msgs.srv.MessageFollowPathRequest¶
The request class for the
navigator_msgs/MessageFollowPath
service.
MessageReactReport¶
- class navigator_msgs.srv.MessageReactReportRequest¶
The request class for the
navigator_msgs/MessageReactReport
service.- animal_array¶
List of animals (P,C,T), up to three animals (Platypus, Turtle, Croc)
- Type
string[]
MessageUAVReplenishment¶
- class navigator_msgs.srv.MessageUAVReplenishmentRequest¶
The request class for the
navigator_msgs/MessageUAVReplenishment
service.
MessageUAVSearchReport¶
- class navigator_msgs.srv.MessageUAVSearchReportRequest¶
The request class for the
navigator_msgs/MessageUAVSearchReport
service.- object1¶
The object found (R or N)
- Type
string
- object1_latitude¶
The latitude of object 1
- Type
float64
- object1_n_s¶
The N/S of object 1
- Type
string
- object1_longitude¶
The longitude of object 1
- Type
float64
- object1_e_w¶
The E/W of object 1
- Type
string
- object2¶
The object found (R or N)
- Type
string
- object2_latitude¶
The latitude of object 2
- Type
float64
- object2_n_s¶
The N/S of object 2
- Type
string
- object2_longitude¶
The longitude of object 2
- Type
float64
- object2_e_w¶
The E/W of object 2
- Type
string
ScanTheCodeMission¶
AUVSI Communication¶
Below outline classes that are used to allow NaviGator to communicate with AUVSI-specific platforms.
RobotXEntranceExitGateMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXEntranceExitGateMessage[source]¶
Handles formation of entrance and exit gates message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- message_id¶
The ID of the message to signal that it is related to the entrance and exit gates.
- Type
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Constructs a list of data values and a checksum list from a provided message.
- Parameters
- Returns
A tuple representing two values. The first is the list of data values encoded in the message. The second value is the checksum list encoded in the message.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, data: MessageEntranceExitGateRequest, use_test_data: bool) → str[source]¶
Constructs a message using the provided parameters. This message is formatted according to 2022 AUVSI specifications.
- Parameters
delim (str) – The delimiter to use in between data values.
team_id (Any) – A value (??) that can be converted to a string to represent the MIL team ID.
aedt_date_time (Any) – A value (??) used to represent the current date + time in AEDT.
data (MessageEntranceExitGateRequest) – The data about the entrance/exit gate mission.
use_test_data (bool) – Whether to use test data in the message. If
True
, then most of the other parameters are ignored.
- Returns
The encoded message.
- Return type
RobotXDetectDockMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXDetectDockMessage[source]¶
Handles formation of detect dock message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Constructs a list of data values and a checksum list from a provided message.
- Parameters
- Returns
A tuple representing two values. The first is the list of data values encoded in the message. The second value is the checksum list encoded in the message.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, data: MessageDetectDockRequest, use_test_data: bool) → str[source]¶
Constructs a message using the provided parameters. This message is formatted according to 2022 AUVSI specifications.
- Parameters
delim (str) – The delimiter to use in between data values.
team_id (Any) – A value (??) that can be converted to a string to represent the MIL team ID.
aedt_date_time (Any) – A value (??) used to represent the current date + time in AEDT.
data (MessageDetectDockRequest) – The data about the detect dock mission.
use_test_data (bool) – Whether to use test data in the message. If
True
, then most of the other parameters are ignored.
- Returns
The encoded message.
- Return type
RobotXFindFlingMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXFindFlingMessage[source]¶
Handles formation of find fling message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Constructs a list of data values and a checksum list from a provided message.
- Parameters
- Returns
A tuple representing two values. The first is the list of data values encoded in the message. The second value is the checksum list encoded in the message.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, data: MessageFindFlingRequest, use_test_data: bool) → str[source]¶
Constructs a message using the provided parameters. This message is formatted according to 2022 AUVSI specifications.
- Parameters
delim (str) – The delimiter to use in between data values.
team_id (Any) – A value (??) that can be converted to a string to represent the MIL team ID.
aedt_date_time (Any) – A value (??) used to represent the current date + time in AEDT.
data (MessageFindFlingRequest) – The data about the find fling mission.
use_test_data (bool) – Whether to use test data in the message. If
True
, then most of the other parameters are ignored.
- Returns
The encoded message.
- Return type
RobotXFollowPathMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXFollowPathMessage[source]¶
Handles formation of follow path message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Constructs a list of data values and a checksum list from a provided message.
- Parameters
- Returns
A tuple representing two values. The first is the list of data values encoded in the message. The second value is the checksum list encoded in the message.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, data: MessageFollowPathRequest, use_test_data: bool) → str[source]¶
Constructs a message using the provided parameters. This message is formatted according to 2022 AUVSI specifications.
- Parameters
delim (str) – The delimiter to use in between data values.
team_id (Any) – A value (??) that can be converted to a string to represent the MIL team ID.
aedt_date_time (Any) – A value (??) used to represent the current date + time in AEDT.
data (MessageFollowPathRequest) – The data about the follow path mission.
use_test_data (bool) – Whether to use test data in the message. If
True
, then most of the other parameters are ignored.
- Returns
The encoded message.
- Return type
RobotXHeartbeatMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXHeartbeatMessage[source]¶
Handles formation of the heartbeat message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- message_id¶
The ID identifying the message as a MIL heartbeat message. For the 2022 season, this is
RXHRB
.- Type
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
From a message representing a message as a string, return the data and checksum lists encoded in the string.
- Parameters
- Returns
A tuple, where the first element is a list of data values, and the second element is the checksum info.
- Return type
- to_string(delim: str, team_id: str, aedt_date_time: Any, gps_array: Optional[Any], odom: Optional[Odometry], uav_status: Optional[int], system_mode: Optional[int], use_test_data: bool) → str[source]¶
Given the necessary information to encode in the message, a message (as a string) is created. This message is ready to be sent back through the RobotX communications protocol.
- Parameters
delim (str) – The delimiter to use when separating the data.
team_id (str) – The team ID used by MIL when sending messages.
aedt_date_time (Any) – Presumably (??) a datetime object representing the current time in AEDT.
gps_array (Optional[Any]) – A specific message type containing at least a point. (??)
odom (Optional[Odometry]) – An optional odometry message to encode in the message. If
None
, then empty strings are used in the message instead of the current position.uav_status (Optional[int]) – The status of the UAV. If
None
, then zero is used in the message.system_mode (Optional[int]) – The current mode of the boat. If
None
, then zero is used in the message.use_test_data (bool) – Whether to use a sample message. If so, most of the other parameters are ignored, as they are not needed.
- Returns
The constructed message.
- Return type
RobotXReactReportMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXReactReportMessage[source]¶
Handles formation of react report message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Constructs a list of data values and a checksum list from a provided message.
- Parameters
- Returns
A tuple representing two values. The first is the list of data values encoded in the message. The second value is the checksum list encoded in the message.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, data: MessageReactReportRequest, use_test_data: bool) → str[source]¶
Constructs a message using the provided parameters. This message is formatted according to 2022 AUVSI specifications.
- Parameters
delim (str) – The delimiter to use in between data values.
team_id (Any) – A value (??) that can be converted to a string to represent the MIL team ID.
aedt_date_time (Any) – A value (??) used to represent the current date + time in AEDT.
data (MessageReactReportRequest) – The data about the react report mission.
use_test_data (bool) – Whether to use test data in the message. If
True
, then most of the other parameters are ignored.
- Returns
The encoded message.
- Return type
RobotXScanCodeMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXScanCodeMessage[source]¶
Handles formation and sending of scan the code message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- message_id¶
The ID identifying the message as a Scan the Code message type. Equal to
RXCOD
.- Type
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Returns the information encoded in a message.
- Parameters
- Returns
The tuple containing a list of data values as the first value, and a list of checksums as the second value.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, color_pattern: str, use_test_data: bool) → str[source]¶
Constructs a Scan the Code status message.
- Parameters
delim (str) – The string delimiter used to separate distinct data points in the message.
team_id (Any) – The team ID used by MIL in the competition.
aedt_date_time (Any) – The datetime to send in AEDT.
color_pattern (str) – The color pattern to send in the message.
use_test_data (bool) – Whether to use test data when sending the message.
- Returns
The constructed message.
- Return type
RobotXUAVReplenishmentMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXUAVReplenishmentMessage[source]¶
Handles formation of UAV replenishment message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- message_id¶
The ID of the message to signal that it is related to the uav replenishment message.
- Type
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Constructs a list of data values and a checksum list from a provided message.
- Parameters
- Returns
A tuple representing two values. The first is the list of data values encoded in the message. The second value is the checksum list encoded in the message.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, data: MessageUAVReplenishmentRequest, use_test_data: bool) → str[source]¶
Constructs a message using the provided parameters. This message is formatted according to 2022 AUVSI specifications.
- Parameters
delim (str) – The delimiter to use in between data values.
team_id (Any) – A value (??) that can be converted to a string to represent the MIL team ID.
aedt_date_time (Any) – A value (??) used to represent the current date + time in AEDT.
data (MessageUAVReplenishmentRequest) – The data about the WAV replenishment mission.
use_test_data (bool) – Whether to use test data in the message. If
True
, then most of the other parameters are ignored.
- Returns
The encoded message.
- Return type
RobotXUAVSearchReportMessage¶
- deffrom_string
- defto_string
- class navigator_robotx_comms.RobotXUAVSearchReportMessage[source]¶
Handles formation of UAV search report message.
Warning
The following code pertains to the 2022 edition of the AUVSI RobotX competition, held in Australia. Updates to the specifications may have changed since this competition, and therefore, the code may not accurately represent the specifications MIL must produce for the competition.
- message_id¶
The ID of the message to signal that it is related to the uav search report message.
- Type
- from_string(delim: bytes, string: str) → Tuple[List[str], List[str]][source]¶
Constructs a list of data values and a checksum list from a provided message.
- Parameters
- Returns
A tuple representing two values. The first is the list of data values encoded in the message. The second value is the checksum list encoded in the message.
- Return type
- to_string(delim: str, team_id: Any, aedt_date_time: Any, data: MessageUAVReplenishmentRequest, use_test_data: bool) → str[source]¶
Constructs a message using the provided parameters. This message is formatted according to 2022 AUVSI specifications.
- Parameters
delim (str) – The delimiter to use in between data values.
team_id (Any) – A value (??) that can be converted to a string to represent the MIL team ID.
aedt_date_time (Any) – A value (??) used to represent the current date + time in AEDT.
data (MessageUAVReplenishmentRequest) – The data about the WAV replenishment mission.
use_test_data (bool) – Whether to use test data in the message. If
True
, then most of the other parameters are ignored.
- Returns
The encoded message.
- Return type
RobotXStartServices¶
- defget_aedt_date_time
- defgps_coord_callback
- defgps_odom_callback
- defhandle_detect_dock_message
- defhandle_entrance_exit_gate_message
- defhandle_find_fling_message
- defhandle_follow_path_message
- defhandle_heartbeat_message
- defhandle_react_report_message
- defhandle_scan_code_message
- defhandle_uav_replenishment_message
- defhandle_uav_search_report_message
- defkill_callback
- defscan_the_code_callback
- defsystem_mode_callback
- defuav_status_callback
- defupdate_system_mode
- defwrench_callback
- class navigator_robotx_comms.nodes.robotx_comms_client.RobotXStartServices[source]¶
Initializes services and subscribes to necessary publishers in order to facilitate the transmission of messages between the robot client and the Technical Director server.
This class is part of a node that should be launched when communication is necessary with official AUVSI software.
- robotx_client¶
The client used to connect with the Technical Director server.
- Type
- get_aedt_date_time() → str[source]¶
Gets the current time in AEDT in the format of
%d%m%y{self.delim}%H%M%S
. This is the format specified by AUVSI to use in messages.- Returns
The constructed string representing the date and time.
- Return type
- gps_coord_callback(lla: PointStamped) → None[source]¶
Updates the
gps_array
attribute with the most recentPointStamped
message received.
- handle_detect_dock_message(data: MessageDetectDockRequest) → MessageDetectDockResponse[source]¶
Handles requests to make messages to use in the Detect Dock Mission
- Parameters
data (MessageDetectDockRequest) – The request to the service.
- Returns
The response from the service. The response contains the message needed to send to AUVSI.
- Return type
- handle_entrance_exit_gate_message(data: MessageEntranceExitGateRequest) → MessageEntranceExitGateResponse[source]¶
Handles requests to make messages to use in the Entrance and Exit Gate mission.
- Parameters
data (MessageEntranceExitGateRequest) – The request to the service.
- Returns
The response from the service. The response contains the message needed to send to AUVSI.
- Return type
- handle_find_fling_message(data: MessageFindFlingRequest) → MessageFindFlingResponse[source]¶
Handles requests to make messages to use in the Find Fling Mission
- Parameters
data (MessageFindFlingRequest) – The request to the service.
- Returns
The response from the service. The response contains the message needed to send to AUVSI.
- Return type
- handle_follow_path_message(data: MessageFollowPathRequest) → MessageFollowPathResponse[source]¶
Handles requests to make messages to use in the Follow Path Mission
- Parameters
data (MessageFollowPathRequest) – The request to the service.
- Returns
The response from the service. The response contains the message needed to send to AUVSI.
- Return type
- handle_heartbeat_message(_) → None[source]¶
Constructs a heartbeat message according to a timer and sends the formatted message to the AUVSI Technical Director station.
- handle_react_report_message(data: MessageReactReportRequest) → MessageReactReportResponse[source]¶
Handles requests to make messages to use in the React Report Mission
- Parameters
data (MessageReactReportRequest) – The request to the service.
- Returns
The response from the service. The response contains the message needed to send to AUVSI.
- Return type
- handle_scan_code_message(color_pattern: str) → None[source]¶
Handles the color pattern reported over the topic dedicated to the Scan the Code mission.
The color is encoded into a message and sent to the AUVSI Technical Director server.
- Parameters
color_pattern (str) – The color pattern reported by the handled message in the Scan the Code topic.
- handle_uav_replenishment_message(data: MessageUAVReplenishmentRequest) → MessageUAVReplenishmentResponse[source]¶
Handles requests to make messages to use in the UAV Replenishment Mission
- Parameters
data (MessageUAVReplenishmentRequest) – The request to the service.
- Returns
The response from the service. The response contains the message needed to send to AUVSI.
- Return type
- handle_uav_search_report_message(data: MessageUAVSearchReportRequest) → MessageUAVSearchReportResponse[source]¶
Handles requests to make messages to use in the UAV Search Report Mission
- Parameters
data (MessageUAVSearchReportRequest) – The request to the service.
- Returns
The response from the service. The response contains the message needed to send to AUVSI.
- Return type
- kill_callback(alarm: Alarm)[source]¶
Updates the
kill
attribute depending on whether the most recent alarm received by the boat was raised or not.
- scan_the_code_callback(scan_the_code: ScanTheCode)[source]¶
Handles the ScanTheCode message requests by calling
handle_scan_code_message()
with the color pattern specified in the message.- Parameters
scan_the_code (ScanTheCode) – The message to format and send to the Technical Director server.
- system_mode_callback(system_mode: int)[source]¶
Sets the class’
system_mode
attribute when given the most recent system mode.
- uav_status_callback(uav_status: int)[source]¶
Stores the most recent AUV status experienced by the boat.
- update_system_mode() → None[source]¶
Sets
system_mode
according to whether the kill isTrue
and the mode of the boat.
RobotXClient¶
- defconnect
- class navigator_robotx_comms.nodes.robotx_comms_client.RobotXClient(tcp_ip: str, tcp_port: int)[source]¶
Handles communication with Technical Director server at the AUVSI RobotX competition.
This class is generally handled by
RobotXStartServices
.- tcp_port¶
The TCP port allotted for communication between MIL and the Technical Director server at the competition site.
- Type
- connected¶
Whether a connection is intact between the client and the Technical Director server.
- Type
- socket_connection¶
The socket connection. This is initially set to
None
, until it is made inconnect()
.- Type
Optional[socket.socket]
- Parameters
navigator_ball_launcher
- Ball launcher¶
The navigator_ball_launcher
module is used to control the ball launcher
on NaviGator. The module implements the electrical protocol to communicate with
a board that controls the flywheel and servo to drop the balls.
ReleaseBallPacket¶
- class navigator_ball_launcher.ReleaseBallPacket[source]¶
Packet sent by the motherboard to the board to release a ball (aka, spin the servo such that one ball is released.)
A valid response to this packet being sent would be
AckPacket
(if the ball was successfully released) orNackPacket
(if there was an issue).
SetSpinPacket¶
- class navigator_ball_launcher.SetSpinPacket(spin_up: bool)[source]¶
Packet sent by the motherboard to the board to spin up the flywheel.
A valid response to this packet being sent would be
AckPacket
(if the flywheel was successfully spun up) orNackPacket
(if there was an issue).