2. Objectives
• Simplify robot programming
• Make it platform independent
• Enable usage of higher level programming
languages and paradigms
• Build tools that are exciting to use.
3. How a microcontrollers work?
• Initialize hardware
• Set data direction register
• Read/Write to data register
OR
• Interrupts which are like callbacks
6. Work Involved on bot
• MVF gets mapped to move_forward function.
• 70 and 100 are received as STRING which
needs to be converted into UNSIGNED CHAR.
7. What about interrupts?
• exec(open("functionList.py").read());
• init("COM5");
• def test():
• print("tick");
•
• onInterrupt("left",test);
• while 1==1:
• 2==2;
8. Ideally how it should happen
• Bot provides services over Xbee
– low_level/(set_port,get_port)
– Actuators/actuator_id/<instruction>
– Sensors/sensor_id/
– OS/( delay, and other functions )
• Services must be defined at interface level
only
9. Pub/Sub Interfaces for interrupts
• Bot publishes events
• PC subscribes to events
• Vice/Versa
• /subscribe/event_id =>returns
10. Action points:Xbee
• Build a high level protocol over Xbee
• Define only the Xbee interfaces and not
anything at programmable level.
11. The virtual machine
• Almost all code runs inside the serial com ISR
• Maps incoming commands to C functions
• Provides a small key/value data store.
All this code should not be written manually. It
should be generated automatically.
12. What we write manually.
• <platform>
<interface type=“actuator”>
<actuator>left_motor</actuator>
<input>{s1}</input>
<mapping>
<DDR>0xFF</DDR>
<PORTD>0xFF</PORTD>
</mapping>
</interface>
</platform>
This should generate all necessary C code to be run on the
mc.
13. What if we add a gripper?
• We just append the XML with few more blocks
and burn the new code.
• This brings up another service
/actuators/gripper_id/move_by_angle/45
For every accessory we build, we only write a
single XML block.
14. What after that?
• Build wrappers that run on PC in various
programming languages
• Even this code should be auto generated.
• All the code that runs on PC is all about
sending a message to Xbee in certain format
and receiving messages periodically.