Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shepherd fails to run if it's not on a pi #36

Open
Minion3665 opened this issue Nov 12, 2021 · 2 comments
Open

Shepherd fails to run if it's not on a pi #36

Minion3665 opened this issue Nov 12, 2021 · 2 comments
Assignees

Comments

@Minion3665
Copy link
Member

Shepherd uses the raspberry pi GPIO pins and the raspberry pi camera, which means that it can't run without a raspberry pi.

The package fake-rpi is in the dev-dependencies on poetry, but is unused when running sudo python3 app.py; there is not a module to emulate the raspberry pi's camera.

What needs to be done:

  • We need to use the fake-rpi module (or similar) to let the script run
  • We need to only use the fake-rpi module when we're running on a raspberry pi (could we use the presence of the Rpi module to inform this?)
  • It would be good to create a way to fake the raspberry pi's camera interface (perhaps returning static images or similar?)
@Minion3665 Minion3665 self-assigned this Nov 12, 2021
@Minion3665
Copy link
Member Author

  • The robot module seems to need to be located at /home/pi/robot, that should probably be changed if we're not running on a pi

@WillMunns
Copy link
Contributor

WillMunns commented Nov 13, 2021

Shepherd on the Brain is launched as a systemd process, the relative path is predictable and settable by the configuration, if you use relative paths then the brain will work, but it will break if you do things like running shepherd not from its actual directory.

We cannot use ~ for home because of reasons, if we did we would still be hardcoding the directory, so its probably "bad".

We could have the installation of Robot and Shepherd as environment variables, this would break deployed brains if the change slipped into a patch.

Possibly the solution is all of the above, use pathlib to search for a known directory ([robot/]robot?) or file ([robot/]robot/__init__.py) from an ENV, then home/pi/robot, then ../robot then ~/robot. Obviously, if we are doing this then we need to add a message on stdout for where we are getting robot from.

We are already doing something like this for other reasons to find the default team image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants