BCLab-UNM / SC2

Swarmathon Team Code for the NASA Space Challenge 2 Competition
MIT License
2 stars 0 forks source link

Closest volatile #208

Closed Carter90 closed 3 years ago

Carter90 commented 3 years ago

Before I can work on building the excavator code I need to have a structure for the excavator to get vol poses.

so drive the scout around a bit to collect a list of volatiles scout.searchRandomWalk.main() # this can be a bit of baby siting the driver code is not not all there yet so you will have to un beach and give the drive a bit of a kick move or rotate in gazebo for it to keep going

@NOTE recall VolatileException is good! it means we found it so you can ignore that stack trace

rosparam get /volatile_locations_latch # can check the latching is working
rosparam get /volatile_locations # see the list of locations and data
In [3]: rospy.set_param('/volatile_locations_latch', False) ## if you left the latch closed otherwise skip                                                            

In [4]: scoot.get_closest_vol_pose()                                                                                    
[INFO] [1622078147.428174, 1537.266000]: rover pose:           x:53.850630689993714, y:18.77089682511062
[INFO] [1622078147.428943, 1537.266000]: get_closest_vol_pose: x:54.563009255814464, y:60.589286431690795
Out[4]: {'data': 5, 'x': 54.563009255814464, 'y': 60.589286431690795}

In [5]: scoot.remove_closest_vol_pose()                                                                                 

In [6]: scoot.get_closest_vol_pose()                                                                                    
[INFO] [1622078156.070731, 1537.266000]: rover pose:           x:53.850630689993714, y:18.77089682511062
[INFO] [1622078156.071414, 1537.266000]: get_closest_vol_pose: x:53.537877362617714, y:62.36156057558915
Out[6]: {'data': 0, 'x': 53.537877362617714, 'y': 62.36156057558915}

In [7]: scoot.remove_closest_vol_pose()                                                                                 

In [8]: scoot.get_closest_vol_pose() # in this case will be none as there was only 2 volatile spots
abbypribis commented 3 years ago

What does the latching mean?

gmfricke commented 3 years ago

"Enable 'latching' on the connection. When a connection is latched, the last message published is saved and sent to any future subscribers that connect. This is useful for slow-changing or static data like a map."

On May 28, 2021, at 3:29 PM, Abby Pribisova @.***> wrote:

What does the latching mean?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Carter90 commented 3 years ago

"Enable 'latching' on the connection. When a connection is latched, the last message published is saved and sent to any future subscribers that connect. This is useful for slow-changing or static data like a map." On May 28, 2021, at 3:29 PM, Abby Pribisova @.***> wrote: What does the latching mean? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

And in this case I implemented my own latch instead of using the ROS one. You can think of it like the occupied sign for bathroom for the availability of a resource

johncarl81 commented 3 years ago

Looks good :shipit: