What's difference bewteen brickpi3.py and brickpi.py


#1

I have noticed that in the balance bot it imports its functions from package brickpi3.py not brickpi.py

What’s the difference?

The reason that I ask is that the balance bot updates motor control very fast in order to be able to balance. I want to be able to update at this speed also. The reason is that I want to use it with a fast moving robot using computer vision.

When using “BrickPi.MotorSpeed[port1] = speed” I get quite slow updates but the balance bot uses “set_motor_speed(PORT_MOTOR_LEFT , powerLeft)” and gets very fast updates.

I have ran some tests on my robot driving around using computer vision. The program will time how long it is running and count how many frames(loops around the whole control process) it processed then at the end do a simple calculation for FPS. When I am running the motors it only gets about 6 FPS but if I remove “BrickPi.MotorSpeed[port1] = speed” and carry the robot then I get 17FPS so this tells me that the process is way more being bogged down by the motor control rather than the processing of the computer vision.


#2

The brickpi3.py is for the new brickpi3. The other file is for older brickpies. Is that how you spell it brickpies? :slight_smile:
Anyways so what do you mean by running the motors? I’m also confused, are you running brickpi.py on a BrickPi3? What BrickPi are you using?


#3

This is a good question. I brought the brickpi about a month ago then followed the instructions that I found on the this website to install it and have brickpi.py so it seems that I might be running brickpi.py software on a brickpi3 hardware.

the problem that I am trying to solve is making a robot go fast using computer vision. The limiting factor is how fast that I can process the stream of images then update the motors for the fast changing environment in front of the robot. I was expecting that the computer vision would be the bottle neck in the process but now it seems that motor control is far more hungry that computer vision.

question? are the Lego motors stepper motors?


#4

What’s the best way to update to brickpi3?

I used these instructions to setup in first place https://www.dexterindustries.com/BrickPi/brickpi-tutorials-documentation/getting-started/pi-prep/
and clicked modify your own image as I already had lots of stuff on my SD card and didn’t want to loose it like openCV


#5

You’ll need to buy the BrickPi 3 starter kit
It includes the BrickPi3, case, and battery pack. Unfortunately they do not sell the parts individually, but the only thing you wouldn’t need is the battery pack. If your thinking you can upgrade tg firmware to t BricjPi3, you cannot. The whole architecture is totally different, so no firmware update.


#6

Yes it seems that I brought my BrickPi just before the the new BrickPi3 came out and I am running the older BrickPi.


#7

BrickPi3 hardware will not work with BrickPi/BrickPi+ software (brickpi.py), and BrickPi/BrickPi+ will not work with BrickPi3 software (brickpi3.py). The BrickPi3 hardware and software have many improvements over the previous BrickPi/BrickPi+. One of the big improvements (as you noticed) is the communication speed between the Raspberry Pi and the BrickPi(3).

If your hardware works with brickpi.py and not brickpi3.py, then it’s a BrickPi/BrickPi+. If your hardware only works with brickpi3.py, then it’s a BrickPi3. On the bottom of the BrickPi3 board, it has the version number printed (such as v3.x.x).

Lego Mindstorms motors are not stepper motors. They are 9v brushed DC motors with quadrature encoders (NXT motors as well as both styles of EV3 motors).

Regarding an update to BrickPi3, I talked with the customer service team, and they would like be in touch to learn more about the issue, and to see how they can help. You can email them at support@dexterindustries.com


#8

That’s Matt for that.

I am hoping that maybe I can get the BrickPi to be able to do what I want and hope to take the my current BrickPi to its limit before then stepping up hardware because I limited out the last hardware. It’s all about learning!

I did a bit of thinking and because I am updating the motor speeds at such a high rate then I probably don’t need any background PID control to try to balance the speed. I probably just need to be able to update the power level going to the motor (not actual speed control just power control). Is there a way to set power to the BrickPi???

I can easily speed up my computer vision processing to get to maybe as high as 100FPS as much I what I am doing is to put a nice display on the 5" screen for the user to watch and in a higher res than the robot needs for steering.


#9

Sounds like a good idea! The BrickPi+ is very capable. You could also modify t firmware if you needed to. Its available on github so that could be a possibility to improve performance.


#10

Thanks Dexter for your after sales service and supping and delivering for a new BrickPi3 when I have a BrickPi+


#11

Yah Dexter Ind is pretty nice!