User Tools

Site Tools


marvin:ecp5

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
marvin:ecp5 [2009/01/29 00:15] riepermarvin:ecp5 [2009/01/29 09:23] deva
Line 15: Line 15:
   * Make a bluetooth client code Behaviour on the Marvin, that can receive numbers and act on them.   * Make a bluetooth client code Behaviour on the Marvin, that can receive numbers and act on them.
   * Make PC bluetooth application read from keyboard arrows to determine control direction.   * Make PC bluetooth application read from keyboard arrows to determine control direction.
- 
  
 =====The protocol===== =====The protocol=====
Line 27: Line 26:
 On the PC LeJOS has also made a bluetooth interface. This works exactly the same as the one on the NXT, and we therefore simply had to make a connection (listening on the NXT and connecting on the PC) and then creating input/output streams, to make the communication work as intended.  On the PC LeJOS has also made a bluetooth interface. This works exactly the same as the one on the NXT, and we therefore simply had to make a connection (listening on the NXT and connecting on the PC) and then creating input/output streams, to make the communication work as intended. 
  
-Lejos has put a lot of effort into making the bluetooth communication easy to use, and the implementation were therefore quite straight forward. Observe the resulting code below.+LeJOS has put a lot of effort into making the bluetooth communication easy to use, and the implementation were therefore quite straight forward. Observe the resulting code below.
  
-We experienced a lot of slowdown in the balancing thread whenever the bluetooth communication was running, and we had to disable it entirely at numerous occations to avoid the robot falling over.\\ +We experienced a lot of slowdown in the balancing thread whenever the bluetooth communication was running, and we had to disable it entirely at numerous occasions to avoid the robot falling over.\\ 
-We later discovered that the problem could be worked around by disabling some of the other behavoir threads to release more resources, and make Marvin rebalance itself while driving around remote controlled.+We later discovered that the problem could be worked around by disabling some of the other behaviour threads to release more resources, and make Marvin rebalance itself while driving around remote controlled.
  
 Here is a movie of the resulting remote controlled robot, with all other behaviours disabled:\\ Here is a movie of the resulting remote controlled robot, with all other behaviours disabled:\\
 [[http://www.youtube.com/watch?v=CBRJdHbWyV4|{{:marvin:remote.jpg?255x210}}]] [[http://www.youtube.com/watch?v=CBRJdHbWyV4|{{:marvin:remote.jpg?255x210}}]]
 {{youtube>CBRJdHbWyV4?small}} {{youtube>CBRJdHbWyV4?small}}
 +
 +As it can be seen from the video, Marvin is not exactly reacting real-time to the control changes. This is due to the way the BTControl has been implemented, but also because the tilt reference must be incremented gradually, but still has to reach a certain level before an actual forward or backward motion can be seen. Making this incrementation more rapid (and thereby making the reaction faster) will cause Marvin to nosedive.
  
 =====The BTControl class===== =====The BTControl class=====
Line 93: Line 94:
 </code> </code>
  
-And on the PC a window (JFrame) captures keyboard input and redirects their keycode values to the bluetooth stream:+On the PCa window (JFrame) captures keyboard input and redirects their keycode values to the bluetooth stream:
 <code java> <code java>
 NXTComm nxtComm = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH); NXTComm nxtComm = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH);
marvin/ecp5.txt · Last modified: 2009/01/29 10:58 by rieper