I’d like for when I choose an auto in smartdashboard to be able to see the path the robot will take on the field. I have all of the images but I’m not sure how I would do this. The putData method wouldn’t accept an image.
Like I said, I have not used it, but I imagine it would go something like:
import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.cscore.raw.RawSource;
import edu.wpi.first.cscore.VideoMode.PixelFormat;
static final String name = "AutoPath";
static final VideoMode.PixelFormat pixelFormat = VideoMode.PixelFormat.kMJPEG;
static final int width = 640;
static final int height = 400;
static final int fps = 1;
RawSource rs = new RawSource(name, pixelFormat, width, height, fps);
CameraServer.addCamera(rs);
rs.putFrame(...);
The easiest and most portable (between different methods of generating trajectories) method will be to directly draw a trajectory onto your field widget and display the field on the dashboard. You can read about the field widget and how to put a trajectory on it here: