Robotics... hmm... You're right, what I'm trying to do and what roboticists try to do is very similar. Print media, though?
There's a few interesting differences between robotics and simulation. That's not to say they render robotics knowledge inapplicable, but I feel like enumerating them anyway:
- I don't have to deal with imperfect sensors. I have complete knowledge of the state of the system.
- I don't have to deal with imperfect motors. My motors will always exert exactly the torque I tell them to; it's just a matter of telling them to do what will bring about the best results.
- With IRL robotics, the "simulation" and the control logic are asynchronous, and the control logic runs slower than the simulation. In my simulation, on the other hand, the simulation and the control logic run in sequence, repeating together at 60hz.
Regarding that old formulation:
That formulation left out temporal stuff. As I mentioned more recently (including in my previous post), a more generalized formulation would be some function that maps...
(inputs, data) --> (outputs, data')
...where "inputs" includes state info as well as the goal description, and "data" is an arbitrary chunk of scratch memory for use in whatever manner the function needs.
Also, in some cases, such as for the purposes of unpowered airborne maneuvering, it seems like it would be better to use a desired vel/rot for torso2 (the bone to which the head and shoulders attach) instead of the pelvis, and let the system affect the spine1 and spine2 joint torques (the joints between the pelvis, torso1, and torso2 bones).
Experiment: thruster nozzles with thrust vectoring
Terminology note: I may use "jet", "thruster", and "rocket" interchangeably. Earlier in the development of this project, I would've bothered to distinguish... but I realized (after a conversation with my father) that "jet" doesn't have to strictly refer to "a jet engine, with an intake". The term "jet" was around long before jet engines were invented. Consider the acronym JATO, jet-assisted take off... with rockets. Or the manner in which cephalopods rapidly expel water to propel themselves. So it's fine.
My Soldier Dood now has a list of thruster nozzle declarations. Each nozzle declaration has: a bone it attaches to, a position in that bone, a 'center' direction, a maximum angle away from that center the produced force vector can deviate, and a maximum force magnitude. I made a solver which takes a desired net force and torque, and attempts to achieve that by picking thrusts for each nozzle, staying within the nozzle's allowed force cones.
I believe the solver is doing the best it can do given the limitations I imposed, but unfortunately, it's not good enough to reproduce the capabilities the Dood had beforehand. A few possible approaches came to mind:
- Omnidirectional thrusters. This is effectively what I had before implementing this new system, only there were only two thrusters (one in each shoulder bone), and the desired force was split evenly between them (with no consideration for torque). But when I eventually add rendering for the thruster flames, omnidirectional thrusters look bad, because the flames will often be going into the Dood and coming out the other side... especially when jetpacking backwards.
- Thrusters with their "center direction" pointing directions other than downward. Obvious candidates would be putting backward-facing thrusters in both shoulders, leftward-facing ones in the left shoulder, and rightward-facing ones in the right shoulder... front, side, and rear thrusters in the feet might be another possibility. Maybe even front-facing thrusters somewhere on the shoulders or chestpiece?
- Get the pose system to deal with orienting the thruster bones. This would be complicated by the fact that the positions and orientations of the bones the thrusters are mounted to won't update until the next physics tick. Still, in theory... Currently the jetpack will only fire when the Dood is airborne anyway, so if I don't have to worry about an imminent landing, I can get a fair deal of control by moving the feet around. I don't know how I would be able to orient the shoulder bones to control where the shoulder-mounted thrusters point without messing up the aiming of the gun, though.
I feel like some combination of approaches 2 and 3 will ultimately produce the best results. But for now, I've just reverted to the old system (described comparatively in "approach 1").