Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions urc_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ find_package(nav_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/BatteryInfo.msg"
"msg/DetectionBoundingBox.msg"
"msg/StatusLightCommand.msg"
"msg/Waypoint.msg"
"msg/GridLocation.msg"
"msg/OrientationPoses.msg"
"srv/GeneratePlan.srv"
"msg/RoverPoses.msg"
"action/ExecuteAutonomousMission.action"
"action/NavigateToWaypoint.action"

DEPENDENCIES
Expand Down
44 changes: 44 additions & 0 deletions urc_msgs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ contains no runtime nodes.
| Interface | Purpose |
| --- | --- |
| `BatteryInfo` | Battery voltage, charge, current, temperature, and per-cell telemetry |
| `DetectionBoundingBox` | Timestamped YOLO detection, confidence, image size, and pixel bounds |
| `GridLocation` | Unsigned grid-cell coordinates |
| `OrientationPoses` | Header and named pose collection |
| `RoverPoses` | Header and named rover-pose collection |
Expand All @@ -19,13 +20,56 @@ contains no runtime nodes.
| Interface | Purpose |
| --- | --- |
| `GeneratePlan` service | Requests a path between start and goal poses and returns a `nav_msgs/Path` with a success or failure code |
| `ExecuteAutonomousMission` action | Navigates to a waypoint and optionally performs a YOLO or ArUco search while retaining mission context across replans |
| `NavigateToWaypoint` action | Follows a supplied path or plans to a goal, with optional final-heading enforcement and progress feedback |

## Autonomous mission contract

`ExecuteAutonomousMission` is the mission-level interface consumed by the
navigation coordinator. Its `search_mode` has these behaviors:

| Search mode | Behavior after reaching the initial waypoint |
| --- | --- |
| `SEARCH_NONE` | Complete without starting a search |
| `SEARCH_YOLO` | Spiral-search until the requested object is detected, then return its bounding box |
| `SEARCH_ARUCO_1` | Search for ArUco 1 using its 5-10 m detection profile, then navigate to a safe goal within 2 m of the marker |
| `SEARCH_ARUCO_2` | Search for ArUco 2 using its 10-20 m detection profile, then navigate to a safe goal within 2 m of the marker |

Requests supply a `waypoint`; an omitted/default `search_mode` is
`SEARCH_NONE` (0), preserving ordinary A* navigation without search. A blank
search selection means NONE, not a blank waypoint or a string value. The
coordinator must reject unsupported modes before starting navigation; a rejected
ROS action goal has no result. Runtime enforcement is part of ROB-42.

Feedback reports the mission state, distance to the current navigation goal in
meters, and that navigation leg's replan count. A successful result uses
`SUCCESS`: NONE has no detection payload, YOLO returns `bounding_box`, and ArUco
returns `aruco_pose` after the approach succeeds. Read each payload only when its
`has_*` flag is true; pose frames and timestamps come from their headers.

Accepted missions return one terminal result. Failures use `INVALID_REQUEST`
for invalid request data found after acceptance, `NAVIGATION_FAILED` for initial
navigation failure, `SEARCH_FAILED` for search errors, `TARGET_NOT_FOUND` for a
search ending without a target, or `APPROACH_FAILED` for ArUco approach failure.
Cancellation uses `CANCELED`; `message` provides diagnostic detail.

The coordinator owns the mission action and retains its waypoint and search mode
for the action's entire lifetime. `NavigateToWaypoint` owns each individual
navigation leg and may call `GeneratePlan` repeatedly when it needs to replan.
Neither `NavigateToWaypoint` nor `GeneratePlan` interprets the mission search
mode.

An ArUco approach is a second internal `NavigateToWaypoint` goal within the
original mission. It does not create another mission or start another spiral
search.

The definitions under `msg/`, `srv/`, and `action/` are authoritative for field
types, constants, and result codes. Inspect an installed interface with:

```bash
ros2 interface show urc_msgs/action/NavigateToWaypoint
ros2 interface show urc_msgs/action/ExecuteAutonomousMission
ros2 interface show urc_msgs/msg/DetectionBoundingBox
```

Changes to these files affect every producer and consumer. Rebuild the workspace
Expand Down
38 changes: 38 additions & 0 deletions urc_msgs/action/ExecuteAutonomousMission.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Goal
# The search mode belongs to the complete mission and must persist across
# navigation replans.
uint8 SEARCH_NONE=0
uint8 SEARCH_YOLO=1
uint8 SEARCH_ARUCO_1=2
uint8 SEARCH_ARUCO_2=3

geometry_msgs/PoseStamped waypoint
uint8 search_mode
---
# Result
uint16 SUCCESS=0
uint16 INVALID_REQUEST=1
uint16 NAVIGATION_FAILED=2
uint16 SEARCH_FAILED=3
uint16 TARGET_NOT_FOUND=4
uint16 APPROACH_FAILED=5
uint16 CANCELED=6

uint16 error_code
string message

bool has_bounding_box
urc_msgs/DetectionBoundingBox bounding_box

bool has_aruco_pose
geometry_msgs/PoseStamped aruco_pose
---
# Feedback
uint8 STATE_NAVIGATING=0
uint8 STATE_SEARCHING=1
uint8 STATE_PLANNING_APPROACH=2
uint8 STATE_APPROACHING=3

uint8 mission_state
float32 distance_to_goal
uint16 replan_count
13 changes: 13 additions & 0 deletions urc_msgs/msg/DetectionBoundingBox.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Image-space detection returned by an autonomous perception mission.
std_msgs/Header header

string class_name
float32 confidence

uint32 image_width
uint32 image_height

uint32 x_min
uint32 y_min
uint32 x_max
uint32 y_max
3 changes: 2 additions & 1 deletion urc_msgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<depend>std_msgs</depend>
<depend>builtin_interfaces</depend>
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand All @@ -26,4 +27,4 @@
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
</package>
Loading