iocchi / PetriNetPlans

Petri Net Plans library and applications
31 stars 15 forks source link

Inconsistent IDs in pnp_ros #7

Closed cdondrup closed 8 years ago

cdondrup commented 8 years ago

Hi,

I am just looking into pnp_ros and tried to write my own action server in python. Doing so, I noticed that for concurrent actions I get inconsistent ids between them. My plan is here:

screenshot from 2016-07-21 16 17 10 And can be downloaded from: here

The process I am following is:

Everything works fine and as expected but when looking at /PNP/goal I get the following:


---
header: 
  seq: 4
  stamp: 
    secs: 1469113949
    nsecs: 323122525
  frame_id: ''
goal_id: 
  stamp: 
    secs: 1469113949
    nsecs: 323122802
  id: /pnp_ros-5-1469113949.323122802
goal: 
  id: 3
  robotname: dummy
  name: goto
  params: home
  function: start

---
header: 
  seq: 5
  stamp: 
    secs: 1469113949
    nsecs: 425441647
  frame_id: ''
goal_id: 
  stamp: 
    secs: 1469113949
    nsecs: 425441944
  id: /pnp_ros-6-1469113949.425441944
goal: 
  id: 4
  robotname: dummy
  name: wait
  params: 15
  function: start

---
header: 
  seq: 6
  stamp: 
    secs: 1469113954
    nsecs: 345764041
  frame_id: ''
goal_id: 
  stamp: 
    secs: 1469113954
    nsecs: 345769806
  id: /pnp_ros-7-1469113954.345769806
goal: 
  id: 4
  robotname: dummy
  name: goto
  params: home
  function: end

---

So goto home is started with id: 3 and wait 15 is started with id: 4. I do, however, get a goto home end with id: 4 instead of id: 3 and never a wait 15 end. For the example python action server that does not make a difference because all the tasks take the same time and, therefore, end at the same time. In my action server this is not the case which is why the:

header: 
  seq: 6
  stamp: 
    secs: 1469113954
    nsecs: 345764041
  frame_id: ''
goal_id: 
  stamp: 
    secs: 1469113954
    nsecs: 345769806
  id: /pnp_ros-7-1469113954.345769806
goal: 
  id: 4
  robotname: dummy
  name: goto
  params: home
  function: end

---

goal kills the wait 15 because that had id: 4 when it started. Currently I am only using the id when keeping track of goals because I assumed that this would be consistent and unique across the actions. My question now is, is this expected behaviour (I might not have gotten the point of how concurrency is handled) or is this an implementation error?

I am currently using the version from @marc-hanheide's fork (#6) because I could just install it using the package manager. If this has been fixed in one of the later commits, please let me know.

EDIT:

The IDs in the pnp_ros print outs are correct:

[ INFO] [1469176081.758018792]: Start: dummy wait 30 - ID: 1
[ INFO] [1469176111.898731425]: End: dummy wait 30 - ID: 1
[ INFO] [1469176111.900520968]: Start: dummy say hello - ID: 2
[ INFO] [1469176112.101006581]: End: dummy say hello - ID: 2
[ INFO] [1469176112.122491848]: Start: dummy goto home - ID: 3
[ INFO] [1469176112.223835086]: Start: dummy wait 15 - ID: 4
[ INFO] [1469176112.424389580]: End: dummy goto home - ID: 3

but also here the End: dummy wait 15 - ID: 4 is missing.