Save and retrieve data on the robot (Database)

Hi

I would like to save a list of data in the robot. Similar to a database (Example: SQLite). You would need around 4 columns and several records and then you would need to retrieve these values. I believe you can do something with JSON but I would like to know if anyone has already done something like this using JAVA and WPI? Another problem I see is the limitation of storage space, I don’t even know how this works in RoboRIO. I’ll wait, thank you.

I don’t know what/why you need a database.

I would look at the Preferences API, as it will persist data on a file in your Rio: Setting Robot Preferences — FIRST Robotics Competition documentation It would also put the data on NetworkTables, so you can tune it on the fly.

If you are insistent on using a database or something, remember the Rio is just a Linux PC (with a really old kernel). You can do file IO to read/write files to it. Just watch out you don’t fill the storage (you have hundreds of MBs on a Rio1).

1 Like

Hello.

Thanks Steve. I want to do some tests by saving points in the arena and also a trajectory taken by the robot. I will look into your suggestions. When I solve it I will also post it here. Thank you very much.

why not save your points to the drive-station. you will have far more flexibility that way.

While you can plug a USB flash drive in… any major read/write operations on the RIO are glacially slow. I’d recommend a co-processor for this or using your driver station.

Another option, you could use WpiLib logging for some of this. As long as the data could be on NetworkTables, you can log it quickly (see On-Robot Telemetry Recording Into Data Logs — FIRST Robotics Competition documentation). My team has used it for 2 years now, and it works well. AdvantageScope (which came with WpiLib this season) can view all the data recorded or live. We just stick in a flash drive to the Rio and it auto logs there.

You can also plot your current location and trajectories with it, see The Field2d Widget — FIRST Robotics Competition documentation. AdvantageScope even has a odometry tab that you can plot your robot on it.

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