Jump to content

[WIP] Unity Editor Plugin


VR_Dev

Recommended Posts

 

Another update. I was having such a hard time with foot explosions I was ready to give up for a while, but I made one change which helped it drastically. I was lerping the rotation of the gait to try and slow the foot as it was approaching its target. Then on top of that I tried to manually control the speed for various points in the arc gait. I don't know if it was the combination of those two things or what, but when I switched the rotation to a constant speed I saw dramatic improvements.

I do slow the target point rotation at the beginning and end of the stride. I was finding the foot exploded just as often when it was being picked up off the ground as when it was being placed upon it. Now I have a fixed constant speed when setting the foot down, or lifting it off the ground. The walk speed is only applied to the rotation between lift up and put down.

Now the arc speed sets the whole gait. The translate target position is set based on the % completed of the arc stride. So if the rotation/arc stride is at 40%, the translate across the ground target will be at 40%. This happens for the three feet on left and right. If there is only one translate foot on a side and two rotating strides, the translate will use the average % of the two rotating strides.

Since the rot stride now slows as it approaches the ground, the translate stride also slows as it approaches its target. To keep the craft moving, as soon as the rot target starts to slow, the translate target begins moving on its own at a designated speed. It also has the freedom to move past its target so hopefully the leg is still moving backwards as it is lifted off the ground.

Steering is still in play, but this new gate works really well keeping it straight. 

Fixed ground clearance from foot.

Having trouble with grass/runway in terms of tuning. Grass/terrain slows everything way down, but don't know how to distinguish between the two. Layer names prob.

Did this real quick, ask if you really want any clarifications, may add more as i think about it.

 

 

Edited by VR_Dev
Link to comment
Share on other sites

That's interesting! Do you think that the explosion at gait start could have been the horizontal velocity of the foot along the ground? It looks like the foot isn't picking itself up off the ground as quickly as before. That may be due to your adjustment where the target position begins below the ground.

Link to comment
Share on other sites

  • 2 weeks later...

@VR_Dev Hi, kinda off-topic from these insanely impressive robotics simulations and memory manipulations, lol, but I saw that you mentioned something about getting the IRWrapper working with kOS and IR Next. I've tried a couple of different forks people have made to support the new version of IR, but none of them seem to be able to detect the IR3 addon's availability, because the wrapper runs into the exact problem you mentioned: it can't find the Mechanism assembly. Looking through IR Next's source, it seems that the interface has changed since the IR3 wrapper I found was written, since I can't even find this class in it. Could you expand on how you got it working? I'm on KSP v1.5, kOS v1.1.5.2, and IR Next v3.0.0. I'd greatly appreciate it :)

Link to comment
Share on other sites

On 3/24/2019 at 11:32 PM, ProjectEW said:

@VR_Dev Hi, kinda off-topic from these insanely impressive robotics simulations and memory manipulations, lol, but I saw that you mentioned something about getting the IRWrapper working with kOS and IR Next. I've tried a couple of different forks people have made to support the new version of IR, but none of them seem to be able to detect the IR3 addon's availability, because the wrapper runs into the exact problem you mentioned: it can't find the Mechanism assembly. Looking through IR Next's source, it seems that the interface has changed since the IR3 wrapper I found was written, since I can't even find this class in it. Could you expand on how you got it working? I'm on KSP v1.5, kOS v1.1.5.2, and IR Next v3.0.0. I'd greatly appreciate it :)

Sorry for the delay but I'm currently on vacation. I'm just using the wrapper from the old IR plugin and it works just fine. Pull it out of my repo and you should be good to go.

Edited by VR_Dev
Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Been back at this for a while, but progress has been pretty quick so I haven't posted many updates. 

  • Before I was setting the position of the target transitioning across the ground to the percentage that the arc target was at, this was the exact opposite of what i should have been doing. Now the arc position is set to the percentage or average percentage of the other feet on that sides percent completion to the back target. This allows me to actually set the speed I want. Now if you set walk speed to 3 m/s, the hexapod will actually travel 3 m/s. Once all 3 of the arcing feet are at the front position, the gait next step sequence begins. This allows for a relatively consistent speed, without the hexapod coming to a stop in between strides.
  • Probably the biggest change is switching to a consistent arc with a height half the distance of the gait to a completely customizable gait. The hexapod can only move as fast as the arcing feet can reposition themselves to the forward position. A full arc was far too much distance for them to travel, so I have implemented animation graphs which allow you to set the arc path. By greatly decreasing the distance the arcing feet have to travel, the hexapod can now travel faster than it ever has before. This also helps keep the feet from exploding, because I can control when they should be set down, instead of traveling down fast from the peak of the arc. As you can see in the video however, I have yet to figure out steering with this feature. The hexapod can switch on the fly between the old full arc, and the animation graphs, so I figure when the hexapod detects an uneven surface, or obstacles, it can switch back to the high step method.
  • Here is the arc gait in the video, this is also how stride length is set. Steering will have to manipulate these key points to shorten and lengthen the stride. This also allows for uneven stride offsets, but im not sure the advantage of that. Eventually each gait graph should be set independently, but now they are all sharing this one.

GrL2LEZ.png

  • I also added the ability to set the gait distance from the base servo via script. Before you had to set the servos how you wanted in the hanger, and the gait would be placed at the foot position. Now, as seen in the video, the hexapod starts with its legs as close to the body as possible, then moves them to the desired gate distance. This allows for faster tuning instead of having to go to the hanger and adjust the servos. I can now also set the height above the ground I want the leg bases to be add. This all allows for faster turning.

The software in the video is currently up to date in the development branch of my repo. I have this working in KSP 1.6 with IR Next. I have reworked a lot of the base code to allow me to expand this to other mechs. Soon I plan on challenging myself to getting a bipedal mech to walk. The challenge I look forward to here is maintaining the center of balance throughout the gait.

U0ktvrB.png

 

Link to comment
Share on other sites

19 hours ago, VR_Dev said:

Been back at this for a while, but progress has been pretty quick so I haven't posted many updates. 

I have no idea why it's important to get sophisticated robotics working within KSP, but this is clearly a sophisticated solution to a difficult technical problem, so +1 for cool engineering.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
On 10/5/2019 at 11:05 PM, DylanPruden said:

would there happen to be a place to download any of your crafts?

Hexapod, I can upload the other 2 later.

https://kerbalx.com/clown_baby/Hexapod-V8

Trying to get this plugin to work in 1.8.1. The update to Unity 2019 should mean I can implement the job system and remove any remaining lag in this plugin.

 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...