NODE aruco_decode.py

Note

see also the second step of the markers detection, NODE aruco_detection.cpp

Find the hint associates to a received aruco id

This node has a simple, fundamental, task to carry out: listen for hints from the detection node, and interrogate the Oracle about them to retrieve the hint associated to them. Once the corresponding ID has been received, the node sends them through a topic to the mission manager.

Important to say that the node replaces the Oracle of the second project: this node has beed designed in order to apply as less changes as possible to the code of the previous project.

The node als implements streategies to retry the reqest to the Oracle in case of service failure. This requires because the detection phase sends each detected ID only one time. When a ID has been sent, the node doesn’t send again it, hence each failure has to be handles with attention.

Author

Francesco Ganci

Version

1.0.0

aruco_decode.NODE_NAME = 'aruco_decode'

ROS name of the node

aruco_decode.cbk_aruco_detection(idpack)[source]

read a ArUco ID from the detection unti, find its meaning, and retransmit the associated hint to the system.

Parameters

idpack (std_msgs/Int32) – the ID from the detection unit, see idpack.data

aruco_decode.cl_oracle = None

(client handle)

aruco_decode.on_shut()[source]

simple message saying that the node is going to close

aruco_decode.pub_system = None

(publisher handle)

aruco_decode.resend()[source]

try again to send a message to the oracle

aruco_decode.resend_check()[source]

used by the main thread for checking if there are pending messages to try to send again and decode

aruco_decode.resend_queue = []

the message the decoder was not able to send to the oracle are stored here waiting for a “second chance”.

aruco_decode.service_oracle = '/original_oracle_hint'

channel for interrogat the Oracle about the meaning of the detected ID

aruco_decode.sub_aruco_detection = None

(subscription handle) receive the IDs from ArUco detection

aruco_decode.topic_aruco_detection = '/aruco_detected_ids'

topic from which the node received the IDs from the aruco detection unit

aruco_decode.topic_system = '/oracle_hint'

topic through which transmit the meaning of the ID