nav_get_current_position¶
Overview¶
The nav_get_current_position example retrieves the robot’s current position and orientation in both meters and pixels, based on its localization on a predefined map.
Inputs¶
No mandatory command-line arguments.
The application automatically retrieves the robot’s position.
Outputs¶
- Log messages showing:
The map used for localization.
The robot’s position in meters and pixels.
The robot’s orientation in both radians and degrees.
Execution¶
The application can be executed using:
python3 nav_get_current_position/ --auto-run
Behavior¶
The application initializes and retrieves the robot’s localization data.
It logs the map name, coordinates in meters and pixels, and orientation in radians and degrees.
Once the data is logged, the application completes execution.
Example Output¶
During execution, the output logs follow this pattern:
[INFO] [timestamp] [pyraya.nav_get_current_position]: Auto running the app
[INFO] [timestamp] [pyraya.nav_get_current_position]: Setup
[INFO] [timestamp] [pyraya.nav_get_current_position]: Robot localized using <map_name>
[INFO] [timestamp] [pyraya.nav_get_current_position]: Robot coordinates (meters) = <x_meters>, <y_meters>
[INFO] [timestamp] [pyraya.nav_get_current_position]: Robot coordinates (pixels) = <x_pixels>, <y_pixels>
[INFO] [timestamp] [pyraya.nav_get_current_position]: Robot orientation (radians) = <orientation_radians>
[INFO] [timestamp] [pyraya.nav_get_current_position]: Robot orientation (degrees) = <orientation_degrees>