How to Implement Inverse Kinematics for Hexapod Robot in Python

  Рет қаралды 10,958

Engineer M

Engineer M

Күн бұрын

Пікірлер: 31
@EngineerM
@EngineerM 3 жыл бұрын
The code used in this video is available on my GitHub account: github.com/engineerm-jp/Inverse_Kinematics_KZbin
@Midotaha1234
@Midotaha1234 2 жыл бұрын
Hi , I have a question, is the input to IK x,y,z is obtained from the output of the forward kinematics using readings from servo feedback ? Thanks
@EngineerM
@EngineerM 2 жыл бұрын
The input to the IK is the coordinate of the desired position. So you can choose any value for x, y, z, as long as that point is physically reachable by the leg/arm of your robot.
@mesutkocak7227
@mesutkocak7227 2 жыл бұрын
First of all, thank you very much for making such a video, but there is a point that I do not understand. Line 63 of your code says theta2=beta+alpha. Shouldn't it actually be theta2=beta-alpha?
@EngineerM
@EngineerM 2 жыл бұрын
Hi, thank you so much for visiting my channel! That's a good point. Depending on how you set up the P axis we'd have to consider whether theta2 = beta +/- 1alpha. In the video, the value of P (sqrt(x^2 + y^2) will always be greater than zero, so that means alpha's sign is determined by the value of z. That means, if z is negative, then the alpha would be a negative value. So beta+alpha is essentially beta-alpha.
@oaiwjebdlla
@oaiwjebdlla 2 жыл бұрын
How do you set servo position to a negative number if it can only move 0-180°? Your code gives negative number too, also how do you calculate a leg offset? Thanks and great video
@EngineerM
@EngineerM 2 жыл бұрын
Hi there, you could potentially add an offset to the angle output so that the output angles are in the range of 0~ 180*. For example, if the output is between -90 and 90, then we could do something like, output = output + 90. The leg offsets are values that are phycially measured from the center of the robot to the leg's origin.
@satyananda4389
@satyananda4389 Жыл бұрын
Thank you so much sir, i was able to implement your inverse kinematics method in Quadruped robot for competition and it works perfectly. Now, i want to change into Hexapod by changing some code on quadruped kinematic inverse. But I have a question, what quadrant is for the middle right leg and the middle left leg in? Thanks Sir, im waiting for your reply ✌
@satyananda4389
@satyananda4389 Жыл бұрын
@EngineerM How Sir?
@EngineerM
@EngineerM Жыл бұрын
Hi, it's great to hear that your robot works! I believe the right one can be any of 1st or 4th, and left can be 2nd or 3rd.
@RajMehta-ck2mg
@RajMehta-ck2mg Жыл бұрын
how to implement this for continuously changing coordinates
@EngineerM
@EngineerM Жыл бұрын
I think one of the way to do this task is by interpolation. For example, you can keep generating and sending some way points between the initial and the final (desired) position to the IK function.
@satyananda4389
@satyananda4389 Жыл бұрын
I want to ask sir, Im making quadruped spider robot, How do we know which leg is in which quadrant? and how about the offset angle? im confused about it, Thanks
@EngineerM
@EngineerM Жыл бұрын
Hi, it's great to hear that you're making a robot! Regarding the placement of the legs, you can choose whichever order you like. However, I would choose counter-clockwise ordering because the +ve yaw angles is counter-clockwise around the vertical axis. Also, I would recommend making the +ve x-axis as your reference axis (i.e., offset=0 deg) since it's the simplest (i.e., leg1 has 45deg, leg2 135deg, ...).
@satyananda4389
@satyananda4389 Жыл бұрын
@@EngineerM Thanks for your answer 😁, so i would choose the configuration of the leg like this : Leg Offset Degree = [0, 90, 180, 270] or [45, 135, 225, 315] Front Right Leg : First Quadrant, Offset = 0 or 45 Back Left Leg : Second Quadrant, Offset = 90 or 135 Front Left Leg : Fourth Quadrant, Offset = 270 or 315 Back Right Leg : Third Quadrant, Offset = 180 or 225 Is it correct sir? Im using Trot Gait, and also Dynamixel AX18 Servo. Thanks
@EngineerM
@EngineerM Жыл бұрын
Yes, something like that 👍. Just one thing; should the front left leg be in the second quadrant? (back left third, back right fourth so that they are in counterclockwise order). Nice choice of the servos, by the way :)
@satyananda4389
@satyananda4389 Жыл бұрын
@@EngineerM Thank you for your reply sir In my robot, the front leg and back leg has opposite minimum and maximum angle positions (max angle of the front leg is on the right side, but max angle of the back leg is on the left side) if i choose front left as second quadrant, back left third, back right fourth, the angle of the left foot and right foot has the same change, for example: I want to make the robot move forward (i.e. by reducing the initial coordinate Y of each leg) then the result is: Front Right Angle : Decreased Back Left Angle : Decreased Front Left Angle : Increased Back Right Angle : Increased But if i choose front left as fourth quadrant, back left second, back right third like i said before, the result is: Front Right Angle : Decreased Back Left Angle : Increased Front Left Angle : Increased Back Right Angle : Decreased In Trot Gait, Front Right and Back Left leg has the same movement right? also the Front Left and Back Right. So that's why i choose that configuration, is it okay sir?
@EngineerM
@EngineerM Жыл бұрын
Ohh I see. I think that would work nicely 😃
@ahmedbenyoucef3238
@ahmedbenyoucef3238 2 жыл бұрын
thank you very much for this video. what is the version of your python that run this work?
@EngineerM
@EngineerM 2 жыл бұрын
Hi, I'm using Python 3 (3.7.10) in the video.
@RcpAvc
@RcpAvc 3 жыл бұрын
When is inverse kinematics part 2?
@civicbynature
@civicbynature 3 жыл бұрын
You Rock!
@JackRyanRobtics
@JackRyanRobtics Жыл бұрын
math.atan2
I Built an Arduino Powered Hexapod from Scratch
10:38
Aecert Robotics
Рет қаралды 208 М.
How I animate 3Blue1Brown | A Manim demo with Ben Sparks
53:41
3Blue1Brown
Рет қаралды 686 М.
Ouch.. 🤕⚽️
00:25
Celine Dept
Рет қаралды 17 МЛН
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 9 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 46 МЛН
SISTER EXPOSED MY MAGIC @Whoispelagheya
00:45
MasomkaMagic
Рет қаралды 13 МЛН
Robot Inverse Kinematics With A Hexapod Leg
14:24
JustAnotherMakerChannel
Рет қаралды 69 М.
Hexapod MK2 - Inverse Kinematics
14:03
TechDudes
Рет қаралды 2 М.
How to cheat at Inverse Kinematics
7:19
RoTechnic
Рет қаралды 47 М.
How Robots Use Maths to Move
15:54
James Bruton
Рет қаралды 455 М.
Easy inverse kinematics for robot arms
5:49
RoTechnic
Рет қаралды 88 М.
Quadruped Robot Basics
11:08
robot mania
Рет қаралды 33 М.
Inverse Kinematics in Python and MicroPython
1:00:30
Kevin McAleer
Рет қаралды 19 М.
Самое простое объяснение нейросети
16:30
Программный Кот
Рет қаралды 125 М.
Твоя ПЕРВАЯ НЕЙРОСЕТЬ на Python с нуля! | За 10 минут :3
18:31
Хауди Хо™ - Просто о мире IT!
Рет қаралды 266 М.
Ouch.. 🤕⚽️
00:25
Celine Dept
Рет қаралды 17 МЛН