So I was going to buy myself a hexapod kit, but turns out they cost thousands of dollars, so I built one in my favorite game, Kerbal Space Program. Lots of mechs have been made in the game, some even that walk using simple sequencers to run the robotics. This is incredibly time consuming however, so I decided to develop my own Unity Controller.
I developed a ksp/unity “bridge” using .net memory mapped files which allow me to send values between the two applications, which makes for much, much quicker development. KSP is built targeting .NET 3.5, which doesnt support memory mapped files, so I start a custom process that handles the bridge, then use simple input/output from inside KSP. Overall this technique is pretty efficient, allowing KSP to stay 50+ FPS. My next goal is to send a camera feed from KSP into Unity, so I can view KSP in unity, allowing VR piloting.
So that’s the bridge. In terms of robotics, the legs feature custom written IK code, which sets the servos in KSP. The blue skeleton is the actual servo position, and the red is the IK skeleton it is moving towards. Each servo has it’s own PID controller, which sets the speed of the servo every frame, based on the error between the actual position, and desired IK position. The walking script is some simple logic to move the targets for the legs. Each leg must be at its target before the next walk cycle begins. The target is set along the y axis in order to adjust the hip height to it’s desired position.
I have also rigged the “neck” with IK, to keep the head at a constant position. No video of that yet, but shortly. This will also help control COM on quadrapods.
Thanks for checking it out, I hope this flies here. I have a post over on the KSP forum but its a space exploration game, so mechs don’t always get a lot of attention. I worked super hard on this so I just wanted to show it off. Feel free to hit me with any questions. Lots more updates will be coming.
[size=2][font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][highlight=#ffffff]TODO[/highlight][/font]
[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][highlight=#ffffff]
]Veering while walking/:m]
]Turning in place/:m]
]Ground scanning/:m]
]Traversing slopes/:m]
]VR implementations/:m]
]Quadrapod/Bipedal Mech/:m]
(anyone know if you can post gfycat?)
gfycat.com/HeavyIdealAmericanalligator[/highlight][/font][/size]
[size=2][font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][highlight=#ffffff]gfycat.com/BlaringAssuredCommongonolek[/highlight][/font][/size]
[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][/font]
https://www.youtube.com/watch?v=qtR280F4g4k[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][/font]
https://www.youtube.com/watch?v=N7ZHFMBv7-Q[size=2][font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][highlight=#ffffff]
[/highlight][/font][/size]
https://www.youtube.com/watch?v=EDwlRwMckks
[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][/font]
[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][/font]
[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][/font]
[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][/font]
[font=Roboto, Helvetica Neue, Helvetica, Arial, sans-serif][/font]