Skip to content

Nav Inward Spiraling + GUI Coverage Radius - #224

Open
a3801749 wants to merge 9 commits into
mainfrom
skj/coverage-radius-clean
Open

Nav Inward Spiraling + GUI Coverage Radius#224
a3801749 wants to merge 9 commits into
mainfrom
skj/coverage-radius-clean

Conversation

@a3801749

Copy link
Copy Markdown
Contributor

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.

@ejhon1116 ejhon1116 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

first pass, didnt lookat waypoint or trajectory.will look at rest later

Comment thread msg/GPSWaypoint.msg Outdated
@@ -1,5 +1,6 @@
int8 tag_id
bool enable_costmap
bool enable_costmap # necessary when using debug_course_publisher.launch.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whats up with this comment

Comment thread msg/Waypoint.msg Outdated
@@ -1,3 +1,4 @@
int8 tag_id
bool enable_costmap
bool enable_costmap # necessary when using debug_course_publisher.launch.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whats up with this comment

Comment thread navigation/costmap_search.py Outdated
Comment on lines +316 to +317
if search_center.coverage_radius > 0 and distance_from_center > 0.5 * search_center.coverage_radius:
enable_inward = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can just set enable_inward to this statement and remove the default initialization above

Comment thread navigation/search.py Outdated
context.course.current_waypoint().coverage_radius > 0
and distance_from_center > 0.5 * context.course.current_waypoint().coverage_radius
):
enable_inward = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same comments as above for costmapsearchstate

Comment thread navigation/trajectory.py Outdated
Comment on lines +6 to +7
# inward spiral search trajectory implemented

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

delete this

Comment thread navigation/trajectory.py Outdated
Comment on lines +2 to +3


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whitespace

@ejhon1116

Copy link
Copy Markdown
Contributor

Tested on rover 4/23/26. Looks good

@ejhon1116 ejhon1116 changed the title Skj/coverage radius clean (Inward Spiraling) Nav Inward Spiraling + GUI Coverage Radius Apr 24, 2026
Comment thread navigation/costmap_search.py Outdated
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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove comment

Comment thread navigation/costmap_search.py Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread navigation/costmap_search.py Outdated
Comment on lines +319 to +321
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see above

Comment thread navigation/search.py Outdated
coverage_radius_in = context.node.get_parameter("search.coverage_radius").value

if (
context.course.current_waypoint().coverage_radius > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use search_center

Comment thread navigation/search.py Outdated

if (
context.course.current_waypoint().coverage_radius > 0
and distance_from_center > 0.5 * context.course.current_waypoint().coverage_radius

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use search_center

Comment thread navigation/search.py Outdated
Comment on lines +92 to +94
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see above comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants