Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new service FindValidPose #316

Merged
merged 9 commits into from
Jul 3, 2023
2 changes: 1 addition & 1 deletion mbf_msgs/srv/CheckPath.srv
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ uint8 UNKNOWN = 3 # path is partially in unknown spac
uint8 OUTSIDE = 4 # path is partially outside the map

uint32 last_checked # index of the first pose along the path with return_on state or worse
uint8 state # path worst state (until last_checked): FREE, INFLATED, LETHAL, UNKNOWN...
uint8 state # path worst state (until last_checked): FREE, INSCRIBED, LETHAL, UNKNOWN...
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOS: make comment match the constant name
This should not change checksum: http://wiki.ros.org/ROS/Technical%20Overview#Message_serialization_and_msg_MD5_sums

(2 more)

uint32 cost # cost of all cells traversed by path within footprint padded by safety_dist
# or just by the path if path_cells_only is true
2 changes: 1 addition & 1 deletion mbf_msgs/srv/CheckPoint.srv
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ uint8 LETHAL = 2 # point is in collision
uint8 UNKNOWN = 3 # point is in unknown space
uint8 OUTSIDE = 4 # point is outside the map

uint8 state # point state: FREE, INFLATED, LETHAL, UNKNOWN or OUTSIDE
uint8 state # point state: FREE, INSCRIBED, LETHAL, UNKNOWN or OUTSIDE
uint32 cost # cost of the cell at point
2 changes: 1 addition & 1 deletion mbf_msgs/srv/CheckPose.srv
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ uint8 LETHAL = 2 # robot is partially in collision
uint8 UNKNOWN = 3 # robot is partially in unknown space
uint8 OUTSIDE = 4 # robot is partially outside the map

uint8 state # pose state: FREE, INFLATED, LETHAL, UNKNOWN or OUTSIDE
uint8 state # pose state: FREE, INSCRIBED, LETHAL, UNKNOWN or OUTSIDE
uint32 cost # total cost of all cells within footprint padded by safety_dist
32 changes: 32 additions & 0 deletions mbf_msgs/srv/FindValidPose.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Find the closest free pose to the given one, within the given linear and angular tolerances.
#
# A pose is considered free if the robot footprint there is entirely inside the map and neither in
# collision nor unknown space.
ChristofDubs marked this conversation as resolved.
Show resolved Hide resolved
#
# If no free pose can be found, but we find one partially in unknown space, or partially outside the map,
# we will return it and set state to the corresponding option (unknown space takes precedence).
# Otherwise state will be set to LETHAL.
#
# You can also instruct this service to use current robot's pose, instead of providing one.

uint8 LOCAL_COSTMAP = 1
uint8 GLOBAL_COSTMAP = 2

geometry_msgs/PoseStamped pose # the starting pose from which we start the search
float32 safety_dist # minimum distance allowed to the closest obstacle
float32 dist_tolerance # maximum distance we can deviate from the given pose during the search
float32 angle_tolerance # maximum angle we can rotate the given pose during the search
uint8 costmap # costmap in which to check the pose
bool current_pose # check current robot pose instead (ignores pose field)
bool use_padded_fp # include footprint padding when checking cost; note that safety distance
# will be measured from the padded footprint
---
uint8 FREE = 0 # found pose is completely in traversable space
uint8 INSCRIBED = 1 # found pose is partially in inscribed space
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think the FREE / INSCRIBED distinction is only meaningful for costs related to the center point of the robot, but not the footprint? Maybe just return max_cost and average_cost in the result?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be,,, we just provide the info and the user can decide to ignore it by checking state < LETHAL (most common case)

uint8 LETHAL = 2 # found pose is partially in collision
uint8 UNKNOWN = 3 # found pose is partially in unknown space
uint8 OUTSIDE = 4 # found pose is partially outside the map
ChristofDubs marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd sort these error codes by precedence, i.e. FREE=0, INSCRIBED=1, UNKNOWN=2, OUTSIDE=3, LETHAL=4 (+same ordering in the comments). Then the user can just do a <= check with whatever scenario is still acceptable for them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.... I know would be better,,, but the other services already have this ordering; so I wanted to avoid confusion giving different values to the same constant
we can change all services, thought. Hopefully nobody is using the numeric value!!!


uint8 state # found pose's state: FREE, INSCRIBED, LETHAL, UNKNOWN or OUTSIDE
uint32 cost # found pose's cost (sum of costs over all cells covered by the footprint)
geometry_msgs/PoseStamped pose # the pose found (filled only if state is not set to LETHAL)