LCAS / topological_navigation

The topological navigation framework
Apache License 2.0
31 stars 36 forks source link

Combine execute policy and nav actions in a single script #63

Closed ayu135 closed 3 years ago

ayu135 commented 3 years ago

This removes the execute_policy_server.py file and moves the execute policy action server to the navigation.py script. That script launches both the action servers now.

I have tested this with single robot scenarios for both execute policy and nav actions using toponav2-devel and rasberry polytunnel scenarios.

I am setting up multi sim and havent tested with that yet.

I would be glad if @gpdas and @adambinch can take a look and test this as well

ayu135 commented 3 years ago

As per my discussion with @Jailander and @adambinch I have reworked the navigation.py script. It now has the following:

gpdas commented 3 years ago

I was trying to call both actions at the same time to see what happens.

  1. What is the expected behaviour when we call one action while the other is active? I tried it in one direction (calling toponav when exec_policy is active). robot planned the route for toponav, but continued executing the exec_policy.
  2. I also got this error.
    navigation.py", line 736, in followRoute_tmap2
    self.stat.set_ended(self.current_node)
    AttributeError: 'NoneType' object has no attribute 'set_ended'

Also as a side note, one could use the rasberry_multisim.yaml from toponav2-devel branch of RASberry from my fork for testing.

adambinch commented 3 years ago

Seen that attribute error myself

ayu135 commented 3 years ago

@gpdas @adambinch Can you guys help me reproduce the attribute error mentioned above? When is that happening?

Also for the behaviour when the other action is called when one is executing, it should preempt the other goal and start with the new one. I will test that out a bit more.

adambinch commented 3 years ago

Strange I have been testing this with both action servers for a while now and I am not getting that attribute error

francescodelduchetto commented 3 years ago

I tested with rasberry_multisim.yaml from @gpdas 's branch and I could not reproduce the attribute error as well. However,

[INFO] [1616149149.014484, 2045.535000]: Navigating Case 1 -> res: 1 [INFO] [1616149149.017178, 2045.540000]: Navigating next try: 1 [INFO] [1616149149.106060, 2045.630000]: Creating Reconfigure Client


- the robots always end up stuck in a situation like this while traversing the rows, this may be an in-row navigation problem though

![Screenshot from 2021-03-19 10-30-01](https://user-images.githubusercontent.com/7307164/111767004-198fd900-889e-11eb-970c-c4425b20ad6b.png)
adambinch commented 3 years ago

@ayu135 you mentioned in out google chats that you had a suspicion that the attribute error occurs when sending invalid routes. So tried sending dodgy routes with the execute_policy_mode. Nope still not getting the error.

Maybe we could just do this:

if self.stat is not None:
    self.stat.set_ended(self.current_node)

haha

francescodelduchetto commented 3 years ago

@adambinch @Jailander @ayu135 these commits in https://github.com/ayu135/topological_navigation/pull/2 should solve the errors above, please have a look.

It works for me on the transportation multisim map, ~I still have to check this on the UV map to see if the robots still stop navigating after entering the tunnels as above~ on UV I was just using a short robot which was colliding with the poles.

ayu135 commented 3 years ago

I'll test is, thanks a lot! if that works i guess this is ready to be merged. I will test it today and report back

adambinch commented 3 years ago

Works fine with https://github.com/ayu135/topological_navigation/pull/2. Goal pre-empting is fixed :) @ayu135 if it works for you can you merge that PR into your branch, then merge this one?

ayu135 commented 3 years ago

Yeah it is working fine for me too! Done with my testing and everything seems to be ok now. I am merging this to PR as well