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

GraphNav fixes #486

Closed
IoTDan opened this issue Sep 23, 2024 · 6 comments
Closed

GraphNav fixes #486

IoTDan opened this issue Sep 23, 2024 · 6 comments

Comments

@IoTDan
Copy link
Contributor

IoTDan commented Sep 23, 2024

Hello!

thank you for creating and maintaining this repo. It has been extremely helpful.
I did some work with the GraphNav ROS2 services and action server.

While I was able to get it working, i encountered some issues, and wanted to share them.
I very well could have been using the ROS2 interfaces for SPOT incorrectly, but this usage pattern was built off reading the SPOT V4.0.3 documentation and samples, and looking at the examples, source code and documentation in this REPO.

To get SPOT working using GraphNav, I did the following:

  1. ros2 service call /graph_nav_clear_graph spot_msgs/srv/GraphNavClearGraph
  2. ros2 service call /graph_nav_upload_graph spot_msgs/srv/GraphNavUploadGraph "{upload_filepath: ./map.walk'}"
  3. ros2 service call /graph_nav_set_localization spot_msgs/srv/GraphNavSetLocalization "{method: 'waypoint', waypoint_id: 'canny-mite-VQ.uUPtpNIimADm2yVAsWA=='}"

These work without any issue, with the 3rd step being the waypoint where our base station is.
we did all these from teh command line.

the fourth step , which calls the action server navigate_to had issues.

We found we had to make 3 changes to use this ROS2 action server:

  1. in spot_wrapper/spot_Wrapper/spot_graph_nav.py, we had to add the request for a lease in set_initial_localization_waypoint (new lines 296-298)

     self._lease = self._get_lease()
     self._lease_keepalive = LeaseKeepAlive(self._lease_client)
    
  2. in spot_driver/spot_driver/spot_ros2.py (lines 2823 - 2826) we had to change

        upload_path=goal_handle.request.upload_path,
         navigate_to=goal_handle.request.navigate_to,
         initial_localization_fiducial=goal_handle.request.initial_localization_fiducial,
         initial_localization_waypoint=goal_handle.request.initial_localization_waypoint,
    

to
waypoint_id=goal_handle.request.waypoint_id,

  1. in spot_msgs/action/NavigateTO.action we needed to change the definition from

    string upload_path # Absolute path to map_directory, which is downloaded from tablet controller
    string navigate_to # Waypoint id string for where to go
    bool initial_localization_fiducial # Tells the initializer whether to use fiducials
    string initial_localization_waypoint # Waypoint id to trigger localization

    bool success # indicate successful run of triggered service
    string message # informational, e.g. for error messages

    string waypoint_id

to

string waypoint_id # waypoint ID to navigate to
---
bool success   # indicate successful run of triggered service
string message # informational, e.g. for error messages
---
string waypoint_id 

It looks as though the action server interface changed in implementation, but the action server interface was not updated.

did I call the API wrong, or did we find valid bugs?

thanks
Dan

@khughes-bdai
Copy link
Collaborator

khughes-bdai commented Sep 23, 2024

Hi,
The navigate_to action looks like it hasn't been touched in a while. You are right that the call to spot_wrapper.spot_graph_nav._navigate_to in handle_navigate_to has the wrong arguments. EDIT: I am wondering if this is supposed to instead be spot_wrapper.spot_graph_nav.navigate_initial_localization as this appears to have the correct arguments. Would you mind trying this change?

I am unsure why you would need to rerequest the lease in set_initial_localization_waypoint 🤔 was this an issue with calling the /graph_nav_set_localization service?

@mhidalgo-bdai I know you have done work testing some graph nav functionality recently, had you run into any of these issues? (fyi @tcappellari-bdai)

@IoTDan
Copy link
Contributor Author

IoTDan commented Sep 23, 2024

Thank @khughes-bdai! you maybe correct, but the name navigate_initial_localization seems to imply that it is an initial localization, not go to a waypoint. and the parameters seem to match that understanding.

For clarity, what i am trying to do is set the target waypoint for the robot to go to.

@mhidalgo-bdai
Copy link
Collaborator

mhidalgo-bdai commented Sep 23, 2024

@mhidalgo-bdai I know you have done work testing some graph nav functionality recently, had you run into any of these issues?

We did basic smoke testing at the time, so I did not come across this issue. The fact that API calls don't match though is quite telling. Some git blame'ing shows this issue goes all the way back to the time GraphNav support was split out in bdaiinstitute/spot_wrapper#44. Before that PR, SpotWrapper.navigate_to() had the signature that the Spot ROS 2 node expects. So yeah, this hasn't been used a lot around lately.

Thanks for pointing it out @IoTDan and a PR would be most welcome.

@IoTDan
Copy link
Contributor Author

IoTDan commented Sep 23, 2024 via email

@IoTDan
Copy link
Contributor Author

IoTDan commented Sep 23, 2024

I submitted the following PRs:

"bdaiinstitute/spot_wrapper#141"
"#487"

thanks,

Dan

@khughes-bdai
Copy link
Collaborator

Going to close this issue as both of your PRs have been merged in! Thanks for the contribution

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

No branches or pull requests

3 participants