Closed brettle closed 4 months ago
If the above format is too inefficient, see wpilibsuite/allwpilib#6677.
@CoolSpy3, based on the reply to that issue, I'm going to bite the bullet and see how painful it would be to use NetworkTables for this. Let me know if you object.
I'm not totally opposed to that. I'd be somewhat annoyed that sim communication can't be done fully through a single connection, so I might also suggest considering creating a subclass of SimDevice
/SimDeviceSim
that does basic array parsing (maybe just for int
s, double
s, and/or boolean
s) using strings. If you do want to go with the NT route, . Scratch that, it looks like it doesn't have anything more useful than the WPILib docs.DeepBlueSim/CommandVisualizerClient
might have some useful example code
I'm not totally opposed to that. I'd be somewhat annoyed that sim communication can't be done fully through a single connection, so I might also suggest considering creating a subclass of
SimDevice
/SimDeviceSim
that does basic array parsing (maybe just forint
s,double
s, and/orboolean
s) using strings.
Unfortunately there is no support for string values.
Ah, yes, my bad. I'm too used to seeing the API as JSON.
It's looking like I'll be able to make it work. Fwiw, the size of DeepBlueSim.jar went from 1.6 MB to 21.4 MB.
Scratch that. 9.9 MB after removing camera server and opencv.
Fixed by PR #67.
At the moment, the controller continuously reports
self.position.{xyz}
via theWebotsSupervisor
sim device. This allows robot testing code to confirm the robot is where it is expected to be. I propose that this should be generalized as follows:If a sim value with a name of the form
{pose,velocity}[defPathOrId][index]
is created on theWebotsSupervisor
sim device, then after each subsequent sim timestep, but before the new simTime is reported, the controller will set the corresponding value via something like: