nav_to_location¶
Overview¶
The nav_to_location application allows the user to select a predefined location from an interactive terminal menu and initiates navigation to the selected point.
The application first retrieves and displays the current map and localization status of the robot before proceeding.
Execution¶
The application can be executed using:
python3 nav_to_location/ --auto-run
Inputs¶
No mandatory command-line arguments.
The application automatically retrieves the map and localization status.
The user selects a target location from an interactive menu.
Outputs¶
Log messages indicating the current map and localization status.
Robot navigation to the location selected.
Behavior¶
The application retrieves and displays the robot’s current localization state and the active map.
If the robot is localized, the available locations are displayed in an interactive menu.
The user selects a location, and the robot begins navigation to the chosen point.
If the robot is not localized, the application exits with a message prompting the user to localize the robot.
Once a location is selected, the robot begins navigation.
Example Output¶
### Case 1: Robot is localized and navigates to a selected location
# python3 nav_to_location/ --auto-run
[INFO] [timestamp] [pyraya.nav_to_location]: Auto running the app
[INFO] [timestamp] [pyraya.nav_to_location]: Setup
[INFO] [timestamp] [pyraya.nav_to_location]: Robot localized using Bogota_Office__minigary.101 map
[INFO] [timestamp] [pyraya.nav_to_location]: Current navigation status: 2(IDLE)
[INFO] [timestamp] [pyraya.nav_to_location]:
[WARNING] [timestamp] [pyraya.nav_to_location]: Navigating to home location
[INFO] [timestamp] [pyraya.nav_to_location]: App finish
### Case 2: Robot is not localized
# python3 nav_to_location/ --auto-run
[INFO] [timestamp] [pyraya.nav_to_location]: Auto running the app
[INFO] [timestamp] [pyraya.nav_to_location]: Setup
[INFO] [timestamp] [pyraya.nav_to_location]: Robot is not localized. Please localize it and try again.
[INFO] [timestamp] [pyraya.nav_to_location]: App finish
Key Notes¶
If the robot is not localized, it cannot proceed with navigation.
The interactive menu allows the user to select a destination from predefined locations.
The application ensures the robot only navigates if it has a valid localization state.
If the map does not contain any predefined locations, an error message appears in the console, and the application exits.