Host a server version of robotpy (with sim)

Robotpy sim (and maybe physics) remotely.

Hello,
I was working on setting up one of my courses to use Repl.it and was thinking, there is a lot we could teach some of our programmers remotely. I am wondering what the feasibility would be of setting up something like this with an install of Robot.py.

If it is possible, does anyone know what one would need to do it/ host it?

I have a few thoughts on where.
Repl.it itself (I do not think this is possible as it would need the C++ bindings).
S3? (We may use our credits pretty quickly)?
A Raspberry pi 4 or PC computer with port forwarding? (Probably would only allow one user at a time).

If this is possible, could someone point me in the direction of a resource to start figuring out how to do it?

Thank you.
~Mr. R^2

So from what I understand, you can’t install robotpy locally because you’re using something like a Chromebook or locked down computer?

It also looks like repl.it can install Python packages, so you could just go over to the dependencies tab and install pyfrc, although I guess if you did that you probably couldn’t actually run it, but you could try it and see what happens.

Thank you for your response.

I am running robotpy with no problems. However, I would love for my students to be able to experiment and learn how to build a full robot program from scratch. I do not know how to help them install robotpy on their computers (or if those who are interested have more than a Chromebook as you mentioned) so, I thought it would be wonderful to have a server like repl.it where my students could log in, make a robot (just using the code) and explore robotpy with challenges I make for them and lead them through.

When trying Repl.it, I do not even get to import wpilib (which I cannot install to my knowledge).

    ERROR: RobotPy requires Python 3.6+```
Yet, I tried a repl with Python 3.6 installed.
So, perhaps this is a fool's errand.

If it does have a version Python 3.6 installed, it should work fine if you can install things. It seems likely repl.it would be running on linux – we have prebuilt wheels you can install. See https://robotpy.readthedocs.io/en/stable/install/pyfrc.html#install-linux

1 Like

Thank you. That helped a lot. I am closer. One of my errors was my stupidity. Since I do not control the computer, Pip defaulted to pip2. Once I figured that out, I still needed to use the linux wheels which installed fine. However, running robotpy introduced a host of other issues mostly related to how repl.it works (like trying to use pip to reinstall every import) I need some time to sort them all out. However, this has some potential.

For now I am going to focus on something easier like trajectories :). I am almost there too thanks to this community.
~Mr. R^2

If you want to use halsim-gui, it’d need OpenGL by my understanding. You could potentially write your own simulation plugin though to work around this limitation. Good luck.

3 Likes

If you’re still working at this, gitpod offers an online edition of vscode with vnc (sim gui support).
The repo below is an example for running robotpy in gitpod with a gui.
It is the commands v2 hatchbot example.
The “Open in Gitpod” button in the readme will open a gitpod instance and basic instructions should print out in the terminal.

3 Likes

I got a repl.it version working. It actually might have a better ui layout for the sim than gitpod. The .replit file is ugly due to some workarounds needed for repl but it seems to work.
It is the commands v2 hatchbot example.

repl.it link: (https://repl.it/@vasistavovveti/robotpy-replit-test)

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.