Howto drive robot in simulator 2d field view?

Is there complete documentation which walks a simulation example all the way through to:

  • loading the 2d field view with a field image
  • placing your simulated robot on the field
  • driving it

Given the CTRE DifferentialDrive_Simulation example, In vscode on linux I am able to build and load the simulator interface with gui. But I haven’t be able to figure out how to load a 2d field image or drive the simulated robot on the 2d field view.

Step 4 of Drivetrain Simulation Tutorial — FIRST Robotics Competition documentation

Link to exact page, but the previous steps are useful too. Step 4: Updating Odometry and Visualizing Robot Position — FIRST Robotics Competition documentation

For the mechanics of the GUI, see The Field2d Widget — FIRST Robotics Competition documentation (we probably should add a link to this from the above)


Thank you! Got the example working. Getting our coders to wrap their heads around simulation and its prerequisites will elevate our code. We are very appreciative and thankful for the efforts you have put into simulation support.

FWIW: It was the last documentation item you mentioned that I was missing.

A follow up question…

What needs to be edited to redefine how a keyboard within [System Joysticks] maps key bindings to a joystick in [Joysticks]? Surprisingly few of our coders have usb gamepads or xbox controllers at home. It would be nice to be able to configure custom keyboard key bindings to fully simulate our joystick controls.

Regarding setting up simulation for the first time… The documentation is all there, but a bit difficult to navigate to find everything the first time through. Cross-links between the various locations of simulation documentation would indeed be helpful:

Note, the Simulation User Interface page under Robot Simulation does not mention that the simulation gui is Glass. Perhaps this should be self-evident, but would be a good mention and a good place to link to the Glass Field2d Widget docs

Many hands make for light work. If you can point me to where the documentation exists within a github repository, I will open an issue, update the docs, and submit a pull request.

Thank you again!

1 Like

I agree that a lot of people are getting started with simulation right now and need that information. If you find other issues like this with frcdocs feel free to create issues. We are always looking for more hands updating frcdocs and good work has been done to make the process easy.

Peter can correct me but I don’t think simGUI is glass. They look extremely similar and use the same widgets but they are different (at least in the sense that we don’t want to declare them the same).

You are able to drag a keyboard from System Joysticks to Joysticks right? That controls what controller number gets assigned. Then in the menu bar under DS>Keyboard X Settings you can change how that keyboard behaves.

1 Like

Perfect! Thank you.

I didn’t see the issue come through and we have been getting the same question in other places so I went ahead created the issue, a PR for it, and it looks like it was just merged and became live. Let me know if you think this change doesn’t solve it for you!

jdamin, thank you for beating me to it.