Simulating a virtual Roborio

Yeah, but you really don’t actually want a virtual roborio (and it isn’t going to happen). You just want to run your robot code and test it locally without having to modify it. That will most likely be possible in 2018.

The roborio-vm that nickbrickmaster mentions doesn’t have an FPGA interface, so you can’t actually run wpilib code on it. It’s only really useful for running generic programs compiled for ARM that don’t depend on any specific hardware being present.

So from what I’m getting… A pure wpilib simulation will only be available hopefully around 2018?
That’s sad…

Thanks for everyone that helped…
I guess I’ll just test my code only the one day of the week when I’m going to the facility that has our robot…

If you care that much about it you can switch to Python. Or Toast. Or Strongback. Or watch the wpilib repos over the summer as they get the new simulation pieces.

Just an FYI, I think Toast has been discontinued, as of the 2017 season. From the top of the github

#WHERE’S THE 2017 UPDATE? The ToastAPI, while stable for 2017, will not be officially released. There have been a lot of changes in the past year to the way WPILib is maintained, all of which are for the better. With the recent focus on the GradleRIO build system to be more expansible for multi-project configurations and libraries, a module-loading system similar to Toast’s is not required.

With device libraries being forked over to the manufacturer, simulation will become harder and harder to maintain. For this reason, I encourage teams to drop the simulation model and work more towards unit tests. Unit tests can be done with GradleRIO. When some time is available, I will be writing a post on how to achieve unit tests efficiently and effectively.

Finally, a project as big as this requires a lot of time to maintain, time which I don’t currently have. I am working on much larger projects, and unfortunately I don’t have time for this one. Other projects, such as GradleRIO, however, will be still be maintained.

I’d like to remind you that this is an open source project. If you want to continue using Toast, or turn it into something of your own, I encourage you to fork and modify the repo to your needs.

Be well, ~Jaci

Toast is compatible with 2017 WPILib, with both Toast and non-Toast projects being supported in simulation. The build system support, however, has been discontinued for Toast.

Hope?
Can you please explain what you mean in non-Toast projects?
Is there a way to just launch the wpilib with the toast simulator?
If there is, Do you know how maybe?

We made a java simulator, available here https://github.com/ArcticWarriors/snobot-2017/tree/master/Simulator

We some have (outdated) instructions on how to use it and set it up https://github.com/ArcticWarriors/team-174-resources/wiki/UsingTheSimulator. Looking at our simulation setup is probably the best place to start.

Basically, it mocks out everything WPILibJ does, no code changes required. If you set up the Eclipse project right, you immediately start playing with joysticks and see your motors/solenoids/etc move around. With a small bit of setup you can hook speed controllers to feedback sensors and gearboxes to get a more accurate simulation.

Yes. Running the Toast Jar with the --sim flag will start the simulator and will detect stock WPILibJ jars.


java -jar Toast.jar --sim --search

Where your robot code program is in the toast/modules folder

Hey, Thanks for helping!

I’m looking around and not finding anything about the Toast.jar
Where can I access it, And How would I include the RobotCode that I got into the simulator as a “module”(which I also do not understand fully)

I’m sorry that I’m bugging so much, But I couldnt understand what you said…

You will have to build Toast.jar yourself from source. There are instructions in the repository readme. Copying your jar to the folder toast/modules (relative to your project root) will be enough to make toast discover your wpilib robot code

By “your jar”, Do you mean THE Toast.jar? or my wpilib project that has the robotcode?
If it is the robotcode one, how would I achieve a jar from it… I’m using GradleRIO to build and deploy btw…

When I say “your jar”, I mean your jar. As in your wpilib project jar.
If you’re building your code with GradleRIO, you can locate your .jar file somewhere under build/

Thank you, Ill test it when I get to my working computer today…
I need to go to school now…

Thank you so much for your time…
I feel bad for bugging so much as it seems that someone with the knowledge would probably know what you mean straight away…

I cant seem to find what you mean by toast/modules…
Is it a folder that exists somewhere or something?

I’ve downloaded and built Toast-2.4.14.jar and I tried running it with a few things(in console)…
I always get to the part where Toast says: “Nuking Toast” in the console and
its stuck there for 2 minutes til it stops trying…

I’m a bit new to the whole module thing so I dont know how it works or where to put what so sorry if it annoys that I dont understand some simpler things…

toast/modules should be created for you on a proper load of Toast’s core. As for the hang, I’m not sure why it’s occurring. Unfortunately I don’t have time to start working on Toast again, so I’m going to have to leave it here for the time being.

SnobotSim still has full support (and I am actively porting it to C++ in the offseason so non-Java languages can play around with it). If you don’t mind being handcuffed to Eclipse, you can get it up and running without having to mess around with building your library and ours, moving jars to the right folder, etc.

Looking at Toast for the first time, it looks like we took a very similar approach into developing the simulator. Looks like it has more bells and whistles, like the Profiler, but I made SnobotSim to be as simple and lightweight as possible.

I can always use eclipse just to run simulation…
Is there anything I need to change in the code for SnobotSim to work with it?

I mean, hopefully not. If anything breaks, let me know and I can patch it real quick.

If you download our repo, you should import the two projects in the Simulator folder. You will need to update the Project Dependencies to add your project, and probably remove any of ours (I guess there is one setup step for this simulator)

I was able to run our code with your simulator with some tweaks to the build paths and dependencies, a lot of issues are present like adb logging going spastic in the console etc. but it did technically work. I’m not the person from before I’m just looking for viable simulator options. Hoping 2018 will have a real sim and not this Gazebo and Linux combo with a GTX Titan to move your robot 3 inches a minute.

Yeah, about that…

We recently merged some changes to WPILib’s build system that allows writing simulation HAL backends. It also got rid of the separate simulation copy of WPILib, which was the reason teams usually had to modify their robot code to run it on Gazebo. Last I heard, there’s still a few things we need to implement in halsim like Joysticks and Counters.

Regarding simulation support next year, I only know of someone who volunteered to write a HAL backend for Gazebo with better packaging/installation. Gazebo has stated they’re working on Windows support, but they’re using VS2013. WPILib has moved on to VS2015 because it has much better support for C++11, so I don’t know what we’d do about that.

We only have three to four people actively making commits to the allwpilib repo, so I’d like to stress that which simulators we support ultimately depends on who volunteers time to get it working.