UBC-Thunderbots / Software

Robot Soccer Playing AI
http://www.ubcthunderbots.ca
GNU Lesser General Public License v3.0
53 stars 99 forks source link

Update Thunderloop's `isPowerStable` to work on Pis #3248

Open nimazareian opened 1 month ago

nimazareian commented 1 month ago

Description of the task

read from /usr/bin/dmesg instead.

Acceptance criteria

Blocked By

nimazareian commented 1 month ago

@mkhlb Maybe you can include this change in your Pi/Nano Thunderloop changes.

Mr-Anyone commented 1 month ago

I am not sure if this needs to be changed as well:

https://github.com/UBC-Thunderbots/Software/blob/8e45ea06e21b98fd86f7355fedfcb38533a76589/src/software/jetson_nano/thunderloop.h#L140

This is used here:

I am not sure if the rapsberry pi has this file?

https://github.com/UBC-Thunderbots/Software/blob/8e45ea06e21b98fd86f7355fedfcb38533a76589/src/software/jetson_nano/thunderloop.cpp#L398-L418

Mr-Anyone commented 1 month ago

Also, do we need to update the GPIO class?

nimazareian commented 1 month ago

Yes you're right about the CPU temperature. I believe when I looked into this a few weeks ago, the Pi does have that file, but it returns a constant and inaccurate value. The correct way to check the value is using /opt/vc/bin/vcgencmd measure_temp

Regarding the GPIO class, @mkhlb is looking into refactoring that and Motor service so we can use compilation flags to compile for either of the setups.