Nav Inward Spiraling + GUI Coverage Radius - #224
Conversation
ejhon1116
left a comment
There was a problem hiding this comment.
first pass, didnt lookat waypoint or trajectory.will look at rest later
| @@ -1,5 +1,6 @@ | |||
| int8 tag_id | |||
| bool enable_costmap | |||
| bool enable_costmap # necessary when using debug_course_publisher.launch.py | |||
There was a problem hiding this comment.
whats up with this comment
| @@ -1,3 +1,4 @@ | |||
| int8 tag_id | |||
| bool enable_costmap | |||
| bool enable_costmap # necessary when using debug_course_publisher.launch.py | |||
There was a problem hiding this comment.
whats up with this comment
| if search_center.coverage_radius > 0 and distance_from_center > 0.5 * search_center.coverage_radius: | ||
| enable_inward = True |
There was a problem hiding this comment.
you can just set enable_inward to this statement and remove the default initialization above
| context.course.current_waypoint().coverage_radius > 0 | ||
| and distance_from_center > 0.5 * context.course.current_waypoint().coverage_radius | ||
| ): | ||
| enable_inward = True |
There was a problem hiding this comment.
same comments as above for costmapsearchstate
| # inward spiral search trajectory implemented | ||
|
|
|
|
||
|
|
|
Tested on rover 4/23/26. Looks good |
| distance_between_spirals=context.node.get_parameter("search.distance_between_spirals").value, | ||
| segments_per_rotation=context.node.get_parameter("search.segments_per_rotation").value, | ||
| max_segment_length=context.node.get_parameter("search.max_segment_length").value, | ||
| # max_segment_length=context.node.get_parameter("search.max_segment_length").value, |
| enable_inward = False | ||
|
|
||
| # we set coverage_radius_in to the default parameter value from navigation.yaml | ||
| coverage_radius_in = context.node.get_parameter("search.coverage_radius").value |
There was a problem hiding this comment.
nice python syntax coverage_radius_in = search_center.coverage_radius if search_center.coverage_radius > 0 else context.node.get_parameter("search.coverage_radius").value. Or if that looks chopped make the assignments for this variable close together
| if search_center.coverage_radius > 0: | ||
| # we override coverage_radius_in to be the waypoint's inward spiral coverage radius | ||
| coverage_radius_in = search_center.coverage_radius |
| coverage_radius_in = context.node.get_parameter("search.coverage_radius").value | ||
|
|
||
| if ( | ||
| context.course.current_waypoint().coverage_radius > 0 |
|
|
||
| if ( | ||
| context.course.current_waypoint().coverage_radius > 0 | ||
| and distance_from_center > 0.5 * context.course.current_waypoint().coverage_radius |
| if context.course.current_waypoint().coverage_radius > 0: | ||
| # we override coverage_radius_in to be the waypoint's inward spiral coverage radius | ||
| coverage_radius_in = context.course.current_waypoint().coverage_radius |
…-ros2 into skj/coverage-radius-clean
Summary
Implemented inward spiraling functionality where the user has the option to set an inward spiral radius when creating a waypoint for the rover to conduct a search spiral about.
If an inward spiral radius is set with the cost map enabled and the rover's distance from the center of the radius being more than half the value of the inward spiral radius, the rover will move to the closest point on the inward spiral radius value and begin an inward spiral search towards the center. It will continue going in and out (to and from the inward spiral radius) while conducting its search.
If an inward spiral radius is set with the cost map enabled and the rover's distance from the center of the radius is less than or equal to half the value of the inward spiral radius, the rover will move to the center and conduct and outward spiral search (from the center to the inward spiral radius), and then the rover will begin an inward spiral search pattern.
If an inward spiral radius is set to 0 the rover will conduct an outward spiral search as normal (move to the center, outward spiral, move to the center, outward spiral). The radius used will be set to the default value as seen in navigation.yaml
Did you add documentation to the wiki?
I have not added documentation to the wiki yet; I have not been instructed to do so as of yet. However, I have documented my code in the branch.
How was this code tested?
Tested code in the simulator and on the rover.
Did you test this in sim?
I tested this by ensuring that the inward spiral functionality worked correctly in the following scenarios: coverage radius NOT set; coverage radius set, distance_from_center > 0.5inward_spiral_radius; coverage radius set, distance_from_center <= 0.5inward_spiral_radius. In all cases, the inward spiral functionality was found to work properly. A document with the results with images have been attached to this. The document shows test results from the older simulator, but the process remains the same.
If needed, I can make a new testing doc with images from the current simulator version.
Inward.Spiral.Test.Doc-1.pdf
Did you test this on the rover?
Yes, this was tested by @ejhon1116 on the rover
Did you add unit tests?
No, was told to test on sim.