discover_tracking module¶
- class discover_tracking.Tracker(subscribe=True, callback=None)¶
Bases:
object
Methods
A function that returns the distance that the marker is from the camera .
A function that returns the ID of the ARTag marker.
A function that returns the value of the marker_visible flag.
Subscribes to ROS /visualization_marker topic published by the alavar tracking node.
- get_marker_distance() float ¶
A function that returns the distance that the marker is from the camera . If no marker is visible, returns None.
- Parameters:
- None
- Returns:
- float
The distance that the ARTag marker is from the camera in meters.
Examples
>>> from rover_api.discover_tracking import Tracker >>> tracker = Tracker() >>> if tracker.get_marker_visible(): >>> print(tracker.get_marker_distance())
- get_marker_id() int ¶
A function that returns the ID of the ARTag marker. If no marker is visible, returns None
- Parameters:
- None
- Returns:
- int
The ID of the ARTag marker as a value between 0 and 17.
Examples
>>> from rover_api.discover_tracking import Tracker >>> tracker = Tracker() >>> if tracker.get_marker_visible(): >>> print(tracker.get_marker_id())
- get_marker_visible() bool ¶
A function that returns the value of the marker_visible flag.
- Parameters:
- None
- Returns:
- bool
This boolean represents whether or not the rover’s camera has detected an ARTag marker.
Examples
>>> from rover_api.discover_tracking import Tracker >>> tracker = Tracker() >>> is_visible = tracker.get_marker_visible()
- subscribe_to_marker_topic()¶
Subscribes to ROS /visualization_marker topic published by the alavar tracking node. If subscribe is set to False, call this function to get data from the tracking node
- Parameters:
- None
- Returns:
- None
Examples
>>> from rover_api.discover_tracking import Tracker >>> tracker = Tracker(False) >>> tracker.subscribe_to_marker_topic()