IEEERobotics / high-level

CV, localization, mapping, planning, and generally anything that will run on the PandaBoard
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Entry point for localizer process spawn #2

Closed dfarrell07 closed 11 years ago

dfarrell07 commented 11 years ago

When the controller spawns the localizer process, it needs to point the process at a target function. The function should accept shared data (currently dict of lists and dics) as well as the static map object.

jschornick commented 11 years ago

I'm starting to look at this now.

Initial questions:

jschornick commented 11 years ago

I added a basic entry point at qwe/localizer/localizer.py:run()

We need to nail down what's actually getting passed in terms of the IPC command channel and sent out via shared data updates. Until then, it's just a combination of class to stub classes, wild guesses, and no-ops.

Take a look and let me know if there are any immediate changes that should be made.

dfarrell07 commented 11 years ago

Regarding the shared_data param, because of this issue, it's more complex for anyone working with the shared data if I pass it in a mutable object, like localizer.run() currently accepts. I suggest expanding that param in a similar way to Planner.run().

One use for an IPC channel to localizer could be accepting results of movement actions from nav. I could have controller create a multiprocessing.Queue and pass it to nav and localizer at process start. They could then agree on an object to contain updates, which nav would produce and localizer would consume.

dfarrell07 commented 11 years ago

I committed some changes to controller that should outline how I was thinking of starting localizer.

I'll start localizer with the following:

pLocalizer = Process(target=localizer.run, args=(bot_loc, blocks, zones, corners, waypoints, course_map, qNav_loc))

bot_loc is a dict of the x, y and theta components of the position.

bot_loc = manager.dict(x=None, y=None, theta=None)

qNav_loc is a multiprocessing.Queue for passing motion feedback from nav to localizer.

# Build Queue objects for IPC. Name shows producer_consumer.
# Queue for passing motion feedback to localizer. 
qNav_loc = Queue()

You'll likely not need some of those other shared objects. For now I'll pass them to you, but if there are any you know you don't want, just let me know and I'll remove them.

dfarrell07 commented 11 years ago

Controller now starts localizer correctly. Localizer may need to modify the arguments it expects, in light of today's high-level group modifications of the shared data passed to each process by controller, but that's trivial and out of the scope of this issue.