Skip to content

Module for graphnav#44

Merged
bhung-bdai merged 83 commits intorai-opensource:mainfrom
heuristicus:modular-graphnav
Aug 4, 2023
Merged

Module for graphnav#44
bhung-bdai merged 83 commits intorai-opensource:mainfrom
heuristicus:modular-graphnav

Conversation

@heuristicus
Copy link
Copy Markdown
Contributor

@heuristicus heuristicus commented Jun 29, 2023

jeremysee2 and others added 30 commits April 18, 2023 18:48
* use pytest instead

* add pytest dependency

* fail test on purpose

* remove failing test
…pot_ros2 (rai-opensource#7)

Co-authored-by: Andrew Messing <129519955+amessing-bdai@users.noreply.github.com>
* simple led brightness control, only able to set all leds to same value

* Add power control, but unclear if it is actually possible to set power for aux and external mic

* most basic functional image stream publisher with webrtc

* add compositor to handle IR and webrtc stream selection with services

Add timestamp for the webrtc images

Add compressed version of the webrtc image stream

* Add health wrapper, move body of robotToLocalTime out of spot wrapper object

robotToLocalTime now takes the timestamp and a robot object, which allows it to
be used by the spot cam wrapper as well.

* add handler and wrapper for audio commands

* update webrtc_client to 3.2 version

* add stream quality wrapper and ros handler

* initial implementation of ptz wrapper and handler, can list ptzs

* ptz handler publishes position and velocity of ptzs, can set position and velocity

* add egg info to gitignore
@jbarry-bdai
Copy link
Copy Markdown
Contributor

@kaiyu-zheng can you either test this or work with @smayorga-bdai to test this? we're starting to get blocked on this so let's try and get it in.

@smayorga-bdai
Copy link
Copy Markdown

smayorga-bdai commented Aug 2, 2023

I think theres some regressions. I was able to run our test_graphnav_services script on our internal repo "main" but after checking out heuristicus/modular-graphnav I got the following errors when uploading the graph.

[spot_ros2-1] [INFO] [1690995381.627716334] [Chara.spot_wrapper]: Loaded graph has 111 waypoints and 118 edges
[spot_ros2-1] [ERROR] [1690995381.628465313] [Chara.spot_ros2]: Exception Error:'SpotWrapper' object has no attribute '_current_waypoint_snapshots'; 
[spot_ros2-1]  Traceback (most recent call last):
[spot_ros2-1]   File ".../spot_driver/spot_ros2.py", line 1959, in handle_graph_nav_upload_graph
[spot_ros2-1]     self.spot_wrapper._upload_graph_and_snapshots(request.upload_filepath)
[spot_ros2-1]   File ".../spot_wrapper/wrapper.py", line 1704, in _upload_graph_and_snapshots
[spot_ros2-1]     self._current_waypoint_snapshots[
[spot_ros2-1] AttributeError: 'SpotWrapper' object has no attribute '_current_waypoint_snapshots'
[spot_ros2-1] 

@jbarry-bdai
Copy link
Copy Markdown
Contributor

I think theres some regressions. I was able to run our test_graphnav_services script on our internal repo "main" but after checking out heuristicus/modular-graphnav I got the following errors when uploading the graph.

[spot_ros2-1] [INFO] [1690995381.627716334] [Chara.spot_wrapper]: Loaded graph has 111 waypoints and 118 edges
[spot_ros2-1] [ERROR] [1690995381.628465313] [Chara.spot_ros2]: Exception Error:'SpotWrapper' object has no attribute '_current_waypoint_snapshots'; 
[spot_ros2-1]  Traceback (most recent call last):
[spot_ros2-1]   File ".../spot_driver/spot_ros2.py", line 1959, in handle_graph_nav_upload_graph
[spot_ros2-1]     self.spot_wrapper._upload_graph_and_snapshots(request.upload_filepath)
[spot_ros2-1]   File ".../spot_wrapper/wrapper.py", line 1704, in _upload_graph_and_snapshots
[spot_ros2-1]     self._current_waypoint_snapshots[
[spot_ros2-1] AttributeError: 'SpotWrapper' object has no attribute '_current_waypoint_snapshots'
[spot_ros2-1] 

Oh yeah we need to update spot_ros2 to work with this PR (@bhung-bdai )... Can we not test it until that is done @kaiyu-zheng ?

@jbarry-bdai
Copy link
Copy Markdown
Contributor

@baxelrod-bdai fyi

@heuristicus
Copy link
Copy Markdown
Contributor Author

The main change needed should be to call functions using graphnav with spot_wrapper.spot_graph_nav rather than just the wrapper, and there may be functions whose name changed, but I don't think so.

@bhung-bdai
Copy link
Copy Markdown
Contributor

I think theres some regressions. I was able to run our test_graphnav_services script on our internal repo "main" but after checking out heuristicus/modular-graphnav I got the following errors when uploading the graph.

[spot_ros2-1] [INFO] [1690995381.627716334] [Chara.spot_wrapper]: Loaded graph has 111 waypoints and 118 edges
[spot_ros2-1] [ERROR] [1690995381.628465313] [Chara.spot_ros2]: Exception Error:'SpotWrapper' object has no attribute '_current_waypoint_snapshots'; 
[spot_ros2-1]  Traceback (most recent call last):
[spot_ros2-1]   File ".../spot_driver/spot_ros2.py", line 1959, in handle_graph_nav_upload_graph
[spot_ros2-1]     self.spot_wrapper._upload_graph_and_snapshots(request.upload_filepath)
[spot_ros2-1]   File ".../spot_wrapper/wrapper.py", line 1704, in _upload_graph_and_snapshots
[spot_ros2-1]     self._current_waypoint_snapshots[
[spot_ros2-1] AttributeError: 'SpotWrapper' object has no attribute '_current_waypoint_snapshots'
[spot_ros2-1] 

Oh yeah we need to update spot_ros2 to work with this PR (@bhung-bdai )... Can we not test it until that is done @kaiyu-zheng ?

I'm admittedly confused to the status of this. When I talked to @amessing-bdai, he mentioned there were multiple PRs blocking other things throughout this whole process. That's mainly why I've been hestitant to test it; I just don't know exactly what is dependent on what, so I don't know what order I'm supposed to be evaluating changes.

@jbarry-bdai
Copy link
Copy Markdown
Contributor

@bhung-bdai My understanding of what's going on (from @amessing-bdai who is on vacation) is that:

  • We're not accepting any new PRs involving graph_nav into spot wrapper or spot ros2 until this PR goes in. That is blocking several PRs
  • This PR can't go in until we test it and update spot ros2 to call it correctly. I originally thought we could test it without updating spot ros2 but actually thinking about it more I don't see how.

So I think we need to:

  1. Update spot ros2 to be compatible with this PR
  2. Test that PR and this PR together
  3. Commit them at essentially the same time

I'm hoping the spot ros2 change is somewhat trivial but I haven't actually looked at it...

@bhung-bdai
Copy link
Copy Markdown
Contributor

bhung-bdai commented Aug 2, 2023 via email

@jbarry-bdai
Copy link
Copy Markdown
Contributor

@bhung-bdai he does and the above is the output I believe from running that test (which @smayorga-bdai did with @kaiyu-zheng 's guidance so he can help test this out now!). The problem is that it relies on spot ros2, which isn't compatible with this PR :(

@bhung-bdai
Copy link
Copy Markdown
Contributor

bhung-bdai commented Aug 2, 2023 via email

@heuristicus
Copy link
Copy Markdown
Contributor Author

@bhung-bdai it looks like the last merge of the main branch into this branch unintentionally reintroduced some of the graphnav functions to the wrapper. I will revert and merge correctly.

@bhung-bdai
Copy link
Copy Markdown
Contributor

bhung-bdai commented Aug 3, 2023 via email

@heuristicus
Copy link
Copy Markdown
Contributor Author

Should be corrected now.

…pper.py. Will get rid of these comments upon final revision
@bhung-bdai
Copy link
Copy Markdown
Contributor

Localization HIL test works with the update spot_ros2. I would like to test navigation functions before I approve it though.

@bhung-bdai
Copy link
Copy Markdown
Contributor

Tested our HIL test with spot_ros2 and spot_wrapper, also tested to make sure the navigation and graph list + upload functions still work. Added a minor bug fix.

Copy link
Copy Markdown
Contributor

@bhung-bdai bhung-bdai left a comment

Choose a reason for hiding this comment

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

LGTM

assert self.name_to_id["Node1"] == "ABCDE"
assert self.name_to_id["Node2"] == "DE"

def test_two_waypoints_with_edge_and_localization(self):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a difference between this test and the test above? I'm not as familiar with this code so maybe I'm missing something.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see it now with the self.localization_id set differently.

Copy link
Copy Markdown
Collaborator

@mpickett-bdai mpickett-bdai left a comment

Choose a reason for hiding this comment

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

LGTM s

@bhung-bdai bhung-bdai merged commit d96bdbf into rai-opensource:main Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.