by datahead · 3y ago · 0 comments
I want to start playing with models, sims and collected data for sailboat racing- I know the RL/data science stuff, and I assume a good model of your craft takes time to build, and can be improved with collected data. What are some areas to explore when chaining model -> sim -> RL for performance?
I realize this is an extremely complex topic, with several PhDs worth of potential input- if you had to explain to someone technical what it looks like and where to keep digging, what would you say?
I did not develop the sim itself but did develop the hardware-in-the-loop portion of it along with things like real-time debugging, and output to the hitl. We had the sim rendering cameras which we output from the workstation to custom HDMI bridges over MIPI that we could treat as real cameras on the NVIDIA Xavier AGX. There was a data channel over Ethernet for IMU data.
I made a custom version of Eclipse that interfaced w GDB for debugging, which also was modified to stay in sync w the sim using PTP, w rewind capability.
As for sailboat modeling, yes it’s more complicated because of the effects of both wind and fluid dynamics. If I were approaching this, I’d probably try and find a physics simulator to start with. Getting ground truth will be difficult, but I imagine you would start w the IMU and GPS data off the boat, but having time synced ground truth for the waves and wind will probably be the hardest part.
> The races are indoors, so we can assume 0 wind.
The end.
I suppose hitting the doldrums right out the gate means there's no sunk cost and the GP commenter knows not to attempt this with sailboats.
The only difference between fixed wing and multirotors is the different models for forces in the body frame. A fixed wing aircraft would use an aerodynamic model of whatever complexity you like, and a model for the prop. A multirotor would use multiple prop models, and a drag model for the body. Most models for these things are pretty well defined, but you can choose just about anything that "fits" so long as you can justify it. And you can use the same basic setup for any aircraft (and indeed any robot) with a bit of forethought. The data part is mostly specifying things like, say, damping coefficients that you would then want to measure.
The dynamics are not the difficult part of simulating aircraft for RL, it's actually the rest of the environment. E.g. navigation tasks require you to build a navigable environment around your physics model, and specify things like reward functions.
I'm sure flight simulations have to deal with some amount of fluid mechanics and turbulence to get an accurate simulation, but I suspect it's fairly simple and you can mostly model it accurately enough using Newtonian physics.
But for sailboats, the entire system relies profoundly on the interaction of two separate fluids with a single body and turbulence and viscosity are deeply interwined in making the boat go. Not to mention that the sail itself is a flexible deformable surface.
Seems like an absolute simulation nightmare.
I've made robot models in the past, but never for anything involving water (although I actually have done physics simulations with water but nothing with robots). I don't know anything about sailing and I'm definitely not an expert at building simulations, but I can grok what GP meant and I agree with his assessment.
To give a rough analogy - it would be like trying to learn how to be a racecar driver on a videogame with simplified physics. There are professional drivers that use simulators and iRacing (or Assetto Corsa or a handful of other games) but none of them are training on Need for Speed, and it's because the difference is so stark you're actually handicapping yourself instead of learning how to drive. You need the simulation to be close enough to reality before it starts to become useful.
For this kind of real-world robotics, you can’t optimise in any academic sense so you just have to go for effective and robust.
I've wanted to make a simple sailing game for a while now but found it very hard to actually get something that feels right and compared to other activities there doesn't seem to be great resources on all the different parts of the physical system (in terms of Math).
That's my point. If your learned data is coming from a simulation that doesn't model actual sailboat fluid dynamics, you've learned little.
A robot that learned to sail by studying a hollow cube floating in a bathtub full of marbles is not going to be able to make an actual sailboat do anything useful out on real water.