NESTLab / coms

Communication protocol for distributed Robot communications within ROS
1 stars 0 forks source link

Add merging support to coms #7

Open tylerferrara opened 2 years ago

tylerferrara commented 2 years ago

Auto Merging ♻

1. Broadcaster finds a robot
2. Broadcaster gets local map using NetSimMerger.get_latest()
3. Broadcaster sends msg.Merge over the network
4. Listener gets msg.Merge
5. Listener gets local map using NetSimMerger.get_latest()
6. Listener replies with msg.Merge over the network
7. Listener calls NetSimMerger.request_merge()
8. Broadcaster gets reply and calls NetSimMerger.request_merge() with new map

State Machine Merging 🤖

1. State machine says ("Lets merge with ROBOT_B")
2. State machine makes call NetSimMerger.merge_with(robot_B)
       Within NetSimMerger.merge_with:
        - Get the local map
        - Craft a ms.Merge
        - Publish to topic: `/coms_listening`
3. coms.sim.Sim.Broadcaster listens to `/coms_listeneing` and pushes the message over the network [waits for reply]
4. ROBOT_B: coms.sim.Listener obtains msg.Merge
5. ROBOT_B: gets local map
6. ROBOT_B: replies with its own msg.Merge
7. ROBOT_B: calls NetSimMerger.request_merge()
8. coms.sim.Sim.Broadcaster hears reply
9. coms.sim.Sim.Broadcaster calls NetSimMerger.request_merge()

NOTE: Implement sending messages as a service request in coms.sim.Sim

tylerferrara commented 2 years ago

@cj-mclaughlin @nikopoulospet Should we:

A - send unmerged map back to broadcaster (current plan)

B - merge the local map first, before sending back to broadcaster plan B is synchronous and requires the map to be merged, slowing down replies

nikopoulospet commented 2 years ago

Service callbacks/ handlers are executed in their own thread so I don't think it would matter

https://nu-msr.github.io/me495_site/lecture08_threads.html https://answers.ros.org/question/9543/rospy-threading-model/?answer=13894#post-id-13894