Beaglebone Black controlling p.Brain

Hexapod Robots

Beaglebone Black controlling p.Brain

Postby pem » Sun Dec 22, 2013 2:35 pm

Image
This setup adds a wifi connected Beaglebone Black to the MSR-H01. The BBB communicates with the p.Brain through the 3.3V TTL located on the Bluetooth mount (CN22) on the p.Brain SMB. On the BBB runs a Java program, which sends PIP-commands to the p.Brain and receives sensor information obtained through I2C from the SRF10 back. A SRF10 sonar is constantly measuring the distance to the nearest object in front of the hex. When within 15 cm of an object, forward movement is prohibited.

Through the wifi connecton (simple socket) of the BBB, it receives information from a Sony Sixaxis controller, which is interpreted by the BBB and converted to PIP directional commands.

Power for the BBB is provided by the LiPo battery pack on the Hex, routed through a DE-SW050 http://www.dimensionengineering.com/products/de-sw050 voltage regulator.

Beaglebone Black controlling p.Brain


The log from the Java program running on the BBB shows that it at one point in time (sadly not caught well on the video) it gets too close to the wall and temporarily disables forward movement.
Code: Select all
785,585 HexControl       Waiting for client to connect to port 27573...
786,841 HexControl       Connection accepted
787,477 QueueToSocket    Trying again at regular intervals to connect to 192.168.1.25:48729
830,198 HexControl       Start button: Wake
833,579 PBrainCmd        Command i(16409152) has not received an answer for a long time
836,585 PBrainCmd        Command i(16409152) has not received an answer for a long time
838,034 HexControl       PIP mode set to escaped
838,040 PIPSerialPort    Returned I2C device version no. 255 is unknown, answer discarded
838,169 HexControl       Gait set to 3
838,416 HexControl       3D balance mode set to on
844,214 HexControl       Shortest distance: 53, age (ms): 2581
844,371 HexControl       Shortest distance: 53, age (ms): 2738
844,522 HexControl       Shortest distance: 53, age (ms): 2889
848,024 HexControl       Shortest distance: 35, age (ms): 2540
848,182 HexControl       Shortest distance: 35, age (ms): 2699
848,343 HexControl       Shortest distance: 35, age (ms): 2860
856,594 HexControl       Shortest distance: 26, age (ms): 2537
856,754 HexControl       Shortest distance: 26, age (ms): 2697
859,455 HexControl       Shortest distance: 37, age (ms): 2541
859,774 HexControl       Shortest distance: 37, age (ms): 2860
864,295 HexControl       Shortest distance: 60, age (ms): 2707
864,456 HexControl       Shortest distance: 60, age (ms): 2868
866,830 PIPSerialPort    Discrepancy between expected number of bytes available (12) and actual number of bytes read (16)
876,517 HexControl       Shortest distance: 24, age (ms): 2551
876,681 HexControl       Shortest distance: 24, age (ms): 2715
876,830 HexControl       Shortest distance: 24, age (ms): 2864
877,779 PIPSerialPort    Discrepancy between expected number of bytes available (12) and actual number of bytes read (16)
877,952 HexControl       Too close (13)
877,956 HexControl       stop forward move
880,391 HexControl       Shortest distance: 13, age (ms): 2597
880,550 HexControl       Shortest distance: 13, age (ms): 2757
883,085 HexControl       Shortest distance: 6, age (ms): 2537
883,246 HexControl       Shortest distance: 6, age (ms): 2698
883,408 HexControl       Shortest distance: 6, age (ms): 2860
884,039 HexControl       Shortest distance: 8, age (ms): 2537
884,207 HexControl       Shortest distance: 8, age (ms): 2706
886,915 HexControl       Shortest distance: 12, age (ms): 2546
887,089 HexControl       Shortest distance: 12, age (ms): 2720
887,247 HexControl       Shortest distance: 12, age (ms): 2878
887,388 HexControl       tooClose set to false, forwardstride -128
887,871 HexControl       Shortest distance: 95, age (ms): 2539
888,029 HexControl       Shortest distance: 95, age (ms): 2698
888,180 HexControl       Shortest distance: 95, age (ms): 2849
892,938 PIPSerialPort    Discrepancy between expected number of bytes available (12) and actual number of bytes read (16)
895,947 PIPSerialPort    Discrepancy between expected number of bytes available (12) and actual number of bytes read (16)
897,370 HexControl       Shortest distance: 62, age (ms): 2522
897,569 HexControl       Shortest distance: 62, age (ms): 2721
902,967 PIPSerialPort    Discrepancy between expected number of bytes available (4) and actual number of bytes read (12)
905,903 HexControl       Start button: Sleep

A lot of data is sent and returned over the serial connection between the p.Brain and the BBB, and sometimes it gets a little mixed up. This is reported as the Discrepancy messages in the log.
pem
 
Posts: 45
Joined: Tue Aug 19, 2008 1:47 pm
Location: Copenhagen, Denmark

Re: Beaglebone Black controlling p.Brain

Postby Matt Denton » Sun Jan 05, 2014 1:56 pm

Nice work PEM!

Loving the use of the on board BBB. It should have enough power for all sorts of autonomous applications if one desired!
Matt Denton
AKA: Winchy_Matt

micromagic systems ltd
Matt Denton
Site Admin
 
Posts: 1572
Joined: Tue May 20, 2008 9:15 pm
Location: Winchester UK


Return to Hexapods

Who is online

Users browsing this forum: No registered users and 3 guests