Skip to content

Added tmap2 support for navigation.py and execute_policy #45

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

Merged
merged 8 commits into from
Jan 27, 2021

Conversation

ayu135
Copy link
Contributor

@ayu135 ayu135 commented Nov 19, 2020

This adds the compatibility to tmap2 for navigate.py and execute_policy_server.py and also merges the actions serves for both in a single node.

  • Updated navigate.py to support tmap2
  • Updated execute_policy_server to use tmap2
  • Now both navigate and execute policy action servers run from the same node
  • Updated some functions in tmap utils to support tmap2

Still pending all testing, which i will try to complete soon

@ayu135 ayu135 added WIP Work in progress toponav2 enhancement and removed WIP Work in progress labels Nov 19, 2020
@ayu135 ayu135 linked an issue Nov 24, 2020 that may be closed by this pull request
@adambinch
Copy link
Collaborator

adambinch commented Dec 13, 2020

How do you tell navigation to use tmap2? It looks like it is hard coded as False?
If i set that arg (use_tmap2) to True in navigation.py i get this:

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/adam/rasberry_ws/src/topological_navigation/topological_navigation/scripts/navigation.py", line 253, in MapCallback
    self.topol_map = json.loads(msg.data["pointset"])
TypeError: string indices must be integers, not str

@adambinch
Copy link
Collaborator

adambinch commented Dec 13, 2020

I think https://github.com/ayu135/topological_navigation/blob/febc6c227a9d5beddd0d94fb7c93ae933b2f94f6/topological_navigation/scripts/navigation.py#L253

should be

self.topol_map = json.loads(msg.data)["pointset"]

or better still

self.topol_map = self.lnodes["pointset"]

@ayu135
Copy link
Contributor Author

ayu135 commented Dec 14, 2020

How do you tell navigation to use tmap2? It looks like it is hard coded as False?
If i set that arg (use_tmap2) to True in navigation.py i get this:

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/adam/rasberry_ws/src/topological_navigation/topological_navigation/scripts/navigation.py", line 253, in MapCallback
    self.topol_map = json.loads(msg.data["pointset"])
TypeError: string indices must be integers, not str

Yes, sorry I had intended to have a discussion about that at some point but it slipped my mind. I wasn't sure if it is a better idea to have that as a launch param or a command line arg like you have done in localization.py. I will add it as an arg for now like the other script.

@adambinch
Copy link
Collaborator

adambinch commented Dec 14, 2020

Getting another error when running navigation with tmap2

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/actionlib/simple_action_server.py", line 289, in executeLoop
    self.execute_callback(goal)
  File "/home/adam/rasberry_ws/src/topological_navigation/topological_navigation/scripts/navigation.py", line 271, in executeCallback
    self.navigate(goal.target)
  File "/home/adam/rasberry_ws/src/topological_navigation/topological_navigation/scripts/navigation.py", line 350, in navigate
    and (g_node.name != o_node.name)
AttributeError: 'dict' object has no attribute 'name'

@adambinch
Copy link
Collaborator

adambinch commented Jan 7, 2021

So we need the edge id field to run the navigation and test this PR properly. The edge id field is included in #44. So perhaps that should be merged first @Jailander ?

@ayu135
Copy link
Contributor Author

ayu135 commented Jan 7, 2021

Yeah and also we would need to modify the search_route.py to support tmap2 as well for this to work correctly

Copy link
Collaborator

@adambinch adambinch left a comment

Choose a reason for hiding this comment

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

This Works! :)

@adambinch adambinch merged commit 2ae72fb into LCAS:toponav2-devel Jan 27, 2021
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.

Improve Topological Navigation and Execute Policy Server Implementations
2 participants