aindustriosa / RustyBugA

Firmware for the MightyBugA line follower done in Rust programming language
MIT License
3 stars 3 forks source link

Engine and motor controller #13

Closed eloycoto closed 5 months ago

eloycoto commented 5 months ago

This PR has two commits, one for the feature, and another one with the simple unit test. To be extended if the behaviour is desired.

punkto commented 5 months ago

Thanks @eloycoto !!

First of all. At the lowest level, yes, we use 2 GIPIOs configured as PWM outputs for driving the motors. We also use 2 extra GPIOs per motor to tell the hardware motor driver to drive the motor forward/backwards/do nothing

Regarding the specific pins, here are the references to

Regarding the concrete API for Engine, probably @eLeDe and/or @hmightypirate can give a better opinion than me.

punkto commented 5 months ago

Regarding the tests. They are more than welcome :D

Your proposal is make BSC's library unit tests that are compiled for the host/native architecture in ./test, isn't it? For me that is OK, but expect to have the less logic related code in the BSC. For example, I'm not sure if the Engine part of your code that should implement the differential drive should go in ./libs like the simple logger example. In the logger case, the tests are included in the crate, so we don't need extra folders at the root level. What do you think?

I would also like to make, at least for demonstration purposes, some unit tests for the BSC. Currently I am using the examples folder for manual tests, but I'm not happy with that. I know that are alternatives but I haven't start digging.

eloycoto commented 5 months ago

@punkto a lot of changes has been made to address your concerns :-)

punkto commented 5 months ago

Thanks @eloycoto , seems nice :D. I'll try to get some hardware with motors (or a logic analyzer at least) to test and merge it this week.