I am going to build an Arduino Quadruped Robot. As usual, I will share my source code and show as many pictures as possible, to help those of you who are also building Quadruped robots. The way I do things might not be the best ways, and I am sure you can come up with better solutions, please let me know if you do! :-)
This robot is actually the first robot I wanted to build, but I failed miserably. you can check this out and this. After building a working Arduino Hexapod robot, I feel confident that I can pull it off this time! I recycled the parts from the arduino hexapod robot, and build a body with styrene sheets, so there is no new parts. For Inverse Kinematics, Check out my tutorial:
https://oscarliang.com/inverse-kinematics-and-trigonometry-basics/
I made an excel spreadsheet to simulate the movements of a quadruped robot. It shows detailed inverse kinematics calculations, and it might help those who are having problem understanding IK to visualize the complex computations, also it’s a great help to debug your code.
Download Quadruped Robot Simulation Spreadsheet V1.0
Update on [31/01/2013]
I call this arduino quadruped robot ‘Stalker’, because of the game unit in Star Craft of the same name. (although they look totally different :p)
Table of Contents
Hardware that I use at the moment:
- Arduino Mega
- 12 Servos
- Wii Nunchuck controller
- a few thick styrene sheets (skeleton)
- 6V Ni-MH 4300mh Battery
Plan:
Build Body and Assemble Robot.Test Wii Nunchuck on it.- Write good IK for body rotation, and translation.
- Get it walking!
- Write Android App to achieve more complicated task.
- IR/ Ultra-Sonic Detection and simple AI.
- Terrain Adaption.
============================================================
Project Started – Update 31/03/2013
Basically copied most of the codes from my last Hexapod robot. All I did was to remove the variables related to the middle legs, and modifed the preset variable values to work in the Quadruped Robot, and it actually worked! :) But the movements are quite Awkward, a lot of work need to be done about Inverse Kinamatics. Here is how I made the body:
========================================================================
Quadruped Robot Leg Calibration (Servo Angle Offsets) – Update 03/04/2013
I just didn’t like the body, i thought it was too big! So I spent an evening re-measured, and cut it down from 16cm to 12cm (leg to leg distance).
I have also created a very simple Servo Offset calibration program. As you might know, due to the fact that no servo is perfect, they might tilt to the right a little more than the left, or the other way round. (It could be also caused by the servo brackets) You might want to give it an offset to correct this. It’s very handy when you have a lot of servos like Hexapod/Quadruped Robts have.
[sourcecode language=”cpp”]
// ===========================================================
// blog.OscarLiang.net
// Created on 04/04/2013
//
// ===========================================================
//
// A very simple program to calibrate multiple servo offsets.
// Especially useful if you have a lot of servos, for example
// Hexapod Robots and Quadruped Robots.
//
// ===========================================================
//
// Instructions:
//
// 1. change variable “ServoNum” – number of servos you have.
// 2. change variable “servoPin” – the pins used by your servos.
// 3. upload code to Arduino.
// 4. open serial monitor, use baud rate 9600
// 5. enter + or – in serial monitor to calibrate servo, there
// is a reading printed on the monitor.
// 6. enter n or l to move to next or last servo.
//
// =============================================================
#include
const int ServoNum = 12;
Servo legServo[ServoNum];
int servoPos[ServoNum];
int servoIndex;
int servoPin[ServoNum] = {23, 24, 25,
26, 27, 28,
29, 30, 31,
32, 33, 34};
void setup() {
Serial.begin(9600);
servoIndex = 0;
// ================ Servos ==================
for (int i=0; i<ServoNum; i++){
legServo[i].attach(servoPin[i]);
delay(50);
legServo[i].writeMicroseconds(1500);
servoPos[i] = 1500;
delay(100);
}
delay(500);
Serial.println(“Ready”);
Serial.println(“enter + to increment”);
Serial.println(“enter – to decrement”);
Serial.println(“enter n to proceed to next servo”);
Serial.println(“enter l to go back to last servo”);
}
void loop(){
if ( Serial.available()) {
char ch = Serial.read();
switch(ch){
case ‘+’:
servoPos[servoIndex] += 3;
if(servoPos[servoIndex] >= 2350){
servoIndex = 2350;
Serial.println(“You can’t turn it up anymore (you might damage it!”);
}
else{
legServo[servoIndex].write(servoPos[servoIndex]);
Serial.println(servoPos[servoIndex]);
delay(100);
}
break;
case ‘-‘:
servoPos[servoIndex] -= 3;
if(servoPos[servoIndex] <= 650){
servoIndex = 650;
Serial.println(“You can’t turn it down anymore (you might damage it!”);
}
else{
legServo[servoIndex].write(servoPos[servoIndex]);
Serial.println(servoPos[servoIndex]);
delay(100);
}
break;
case ‘n’:
if(++servoIndex >= 12){
servoIndex = 11;
Serial.println(“we have reached last servo”);
}
else{
Serial.print(“Switched to Pin “);
Serial.println(servoPin[servoIndex]);
}
break;
case ‘l’:
if(–servoIndex < 0){
servoIndex = 0;
Serial.println(“we have reached first servo”);
}
else{
Serial.print(“Switched to Pin “);
Serial.println(servoPin[servoIndex]);
}
break;
default:
Serial.println(“Unknown Command… “);
}
}
}
[/sourcecode]
.
Creeping Gait – Update 15/04/2013
Some Background Gait Knowledge you might want to know:
https://oscarliang.com/quadruped-robot-gait-study/
Tonight I came up with a 20-step Creeping Gait. This gait is how 4 legged animals, for example cats, walk. This is the GaitStep Plan (leg 1 is the top right leg, leg 2 is the bottom right leg… etc…) This follows the idea about creep gait described here:
https://oscarliang.com/quadruped-robot-gait-study/
Circled steps are the leg-lifting steps, and the gait cycle starts at step one where leg starts to be lifted. I copied most of the code on how to generate gait sequence from my previous hexapod robot, you can check out the source code. Here is the source code for the gait I have written: Before we start, we call this function to initialize the variables for the Gait:
[sourcecode language=”cpp”]
void GaitSelect (){
//begining of the step cycle for each leg (with reference to the first leg)
GaitLegNr[LR] = 1;
GaitLegNr[LF] = 6;
GaitLegNr[RR] = 11;
GaitLegNr[RF] = 16;
NrLiftedPos = 5; // number of steps that the leg is in the air
TLDivFactor = 15; // number of steps that the leg is on the ground
StepsInGait = 20; // total steps
}
[/sourcecode]
For a complete Gait cycle (e.g. from step 1 to step 20), we will go through loop() function 20 times, each time we call GaitCalculate(), and then increment ‘GaitStep’ variable.
[sourcecode language=”cpp”]
coor GaitCalculate (){
//Calculate Gait positions
for (int LegIndex = 0; LegIndex < 4; LegIndex++){
if (GaitStep == GaitLegNr[LegIndex]) {
GaitPos[LegIndex].Y = -LegLiftHeight/2;
}
else if (GaitStep == GaitLegNr[LegIndex]+1) {
GaitPos[LegIndex].Z = 0;
GaitPos[LegIndex].Y = -LegLiftHeight;
}
else if (GaitStep == GaitLegNr[LegIndex]+2) {
GaitPos[LegIndex].Z = WalkLength/2;
GaitPos[LegIndex].Y = -LegLiftHeight/2;
}
else if (GaitStep == GaitLegNr[LegIndex]+3) {
GaitPos[LegIndex].Y = 0;
}
else{
// move body forward
GaitPos[LegIndex].Z -= WalkLength/TLDivFactor;
}
}
//Advance to the next step
if (++GaitStep > StepsInGait)
GaitStep = 1;
}
[/sourcecode]
This is by no mean the best implementation, but it might give you an idea how to start doing gaits if you still have no clue. I will keep working on Gait, make it more stable, faster, smoother and maybe come up with some more gait style as well, before I publish my full working code.
Trot Gait – Update 28/04/2013
Right, finally have the time to do some robotics, and this time I made a fist version of Trot Gait for the stalker.
I didn’t look into too much theory stuff to get this gait working, as it pretty straight forward: 2 diagonal legs (1 and 3) lifted and move forward, the other two legs (2 and 4) at the same time move backward, 1 and 3 land. Now 2 and 4 are lifted to move forward while 1 and 3 move backward … And repeat…. Check out my Gait Study post for more detail:
https://oscarliang.com/quadruped-robot-gait-study/
DIY Remote Controller – Update 28/07/2013
I have been working hard on a universal DIY robotic remote controller that uses XBee or Ciesco XRF for wireless communication. I also aim to develop an open source Arduino library that can be easily modified to suit different remote controller configuration. You can find more information on the project post. Hopefully at the end, this remote controller can be used in all sorts of robots and projects that requires manual control.
Servo Horn orientation
Some one asked me what’s the orientation of the leg servo horns. so here is a very rough drawing.
Source Code Download
Google drive: https://drive.google.com/file/d/1TT-M7dhpFXnyLI3WUvMzJPhCECIEeV3h/view?usp=sharing
125 comments
Hi…Oscar, can i still donate and have the code?
Hi Oscar, Can i still have the code for this project after donating?
hi oscar, i have donated 5 dollars. please send source code
i sent a few days ago, check your spam maybe?
Hi, I can’t find the donate button.
hi oscar.. i have the same project could i get the source code
Hello Oscar,
I am working on a similar project and i am struggling to get my robot to walk. My Kinematic model is working fine but the stepping sequence is big problem right now.
Is it still possible to get the source code your project? I will donate 15 euros.
Yes of course :)
Awesome work…..?
Have you calculated Center of Mass and Support Polygon? if yes, then how?
I’m working on a similar project…….
hi oscar, I will donate 10 dollars, will I get the source code?
Yea it’s still available.
Hi, I’m interested in the spreadsheet but unfortunately the link doesn’t work. What should I do to get it?
Thank you so much for posting about your project! I have made a donation, it would be greatly appreciated if you could send along the source code and the spreadsheet for the Quadruped.
Thank you so much Oscar!
Sent :) thanks for the dontation!
Hi Oscar, I will donate 15 U$D, it is possible to email me your code?
Yes of course
Hi…is it possible to use this information for code small spotmini or spotmicro quadruped robot…
Can you please help, what changes needs to be done.
Hi Oscar, If I donate, can I have the design chassis and the source code of this quadruped robot. And does the chassis design have all the femur, tibia, coxa? Thanks for replying me.
No i don’t have the chassis design, only the source code for this robot.
Hi…Oscar, can i still donate and have the code?
Yes :)
Hi Oscar, I’m very interest in your this quadruped robot, can I still donate and get the source code now?
thanks, got your donation, will send you the code shortly.
Hi, I am interested in your Quaduped robot. Coulyou tell me how to donate for Inverse Kinematic and code. I have Visa.
Only paypal donation accepted. The link is on the sidebar that says “Paypal Donate”
Hey Oscar, thanks for this article! But the link to the IK Excel spreadsheet seems to be dead. Can you provide another link?
Hi Oscar,
I am a student working on my first robot and was wondering if you could send me your spreadsheet? I am having some difficulty coding my gait.
My email is crcali AT gmail.com.
How much do I need to donate, if anything, to receive the code?
Also, if I donate, can I receive all the code mentioned on this blog, including both the spreadsheet and the code for the gaits?
Thanks!
Yes I will have the code.
The download link is for Download Quadruped Robot Simulation Spreadsheet V1.0 doesn’t work anymore. However I am interested in the excel, is it possible that I can get a copy?
Hi,
I just donated for the source code, do you think you could send me the code? I’m really struggling with smoothing out the movement on my quad, hope your code will point me in the right direction.
Thank you!
Louis
sent :)
thanks for the donation!
Very nice project. Do you still have the Quadruped Robot Simulation Spreadsheet? The dropbox link doesn’t work.
Are the codes still available for donation ?
thanks
babby
Yes Babby.
Hi,
can I also use the code on Arduino one?
Is the code the same one used by Sunfounder Quadruped ?
Thanks
Gabry
Hi Oscar
I have donated 12 pounds just to be sure it was enough. Would you be able to send me the code for the Quad and Hex?
Great work on the development of these robot!
thanks Brad, I have sent you the code!
Oh i got it , I’ve just trying using my phone , but it;s done by my laptop.
I already donate, so could you please send to me the source code of quadruped robot with remote :)
Hi Oscar, It’s time for me to tackle a quadruped after a couple hexy. Am interested in yr coding n excel spreadsheet.
Just did a contribution. Thks mate.
thank you :)
Hi Oscar
How can I donate to get the source code?
Hi Oscar ,
Is donation is still available ?
Becouse I’m very interested in this project and I plan to make it for my B-tech project .
Hi Hagar
yes the codes are still available for donation.
I am trying to build a quad bot and this would help me very much learn what i am missing. However i cannot find a paypal button anywhere. I am so excited about this since i am a disabled US military veteran and Arduino has been my calming, and i have been fully into coding for about a year. This is what i really want to build.
Hi. Oscar. I am Jack. I just did the donation. Could you send me the source code for both of quadruped one and hexapod? Thanks so much.
Hi. Is the donation still available for the source code? If it is, please let me know as soon as possible. I am learning the programming of four-legged robot. Once you reply me, I will donate immediately. BTW, how can I send you the private messages to tell you which project I am interested in because I think I need both of quadruped robot and hexapod.
Yes Jack, still available :)
no worries i will send you both source code!
Hi Oscar!
Great post!
How do you think if i use plastic gear micro servo?
Are they strong enough to lift frame, arduino and small servo driver circuit?
Thanks!
depends on your payload and robot weight… I tried 9g servos but they are just not strong enough…
Hello as I can the programming of simple Quadruped Robot
thank you!
Hi Oscar!
Donated £10 for your noble cause! Can I please have your Quadruped code (and the remote code please?)
Love your blog, have learnt a lot from it, both about robotics and fpv-quads!
Thanks
Kjell B
Norway
Hello I want a help can I make a basic quadruped with just 12 servos and arduino mega….is servo controller board is necessary?
it is very useful thnk u oscar… can you send me the source code
Hi oscar, can you send me the flow chart of programming of the robot I want to know the sequence of how the robot operate. I already donated for the contribution . Thx :-)
Hi Oscar
I have a question about your Arduino Mega shield what capacitor u using for the both??
If i didnt put the capacitor is it ok ??
that’s fine i think, they are there just because I am paranoid :)
Very well written arcticle. Congrats on making such a wonderful blog. I have donated the amount please share the source code. Thank you.
Code sent! Thanks for the donation :)
Hi Oscar
I m doing the same project as u did
If i donate UK£10 can u send me the full code and also the DIY wireless Remote controller which is link together
and can u list out what electronic component u used in the project THX :)
Hi Mike, yes once the donation is received you will get the code :)
Sorry I don’t have more info than what’s on this page, this project was almost more than 2 years ago…
thanks
Oscar
Donated
Hi Oscar,
I was interested in the code for a quadruped.
if you still have the code, please contact with me.
thank you very much
yes, it’s still available.
Beside that, im using digital servo hs-5645 mg, i wonder whats wrong with my servo PWM pin to arduino, it only generate about 1.5 volt instead of 3.3volt.
im using arduino mega 2560 , and i attach my 12 servo’s signal pin to 2 until 13 pwm pin in arduino. is that okay to do that? am i need servo shield?
Hi, Oscar i just donated today.
Im now in project for quadruped.
can you send your code for the quadruped please? the last one with gait, inverse kinematics, rotation matrix, and coordinate transform. thank you. i want learn from your code.
my email is [email protected], i’ll email to you my donation transaction proof.
hi oscar, have you recieved my donations? if you do please email me back at [email protected] .i would like the source code for this.
regards,
khair
Hi Khair, thanks, code has been sent.
thanks
Oscar
Oscar,
Donated today, thank you in advance for the great code examples you are going to send me. I also fly quadcopter and a tricopter. Looking forward to seeing what I can do on the ground with your project as a base. I will try to post some of the results as I get them.
Thanks again.
thank you very much! Code has been sent earlier today! good luck with the project!
hi is the $10 donation for the code available??
yes it is.
hi oscar is the $10 donation for the code still available? i am doing something similar like you…
yes it is.
Hi Oscar,
is the £10 for the code still available? We are planning to build the same robot but IK is just somewhat beyond us. We would like to see how IK and the gait is implemented in your code.
Thanks
yes :)
hi,
i´m very interested in your code. Please contact me
Thanks
Hi,
Im interested on your quadruped code, do you still have it for a donation?
yes!
Great job man!! I was looking for a good quaduped frame example to start mine and i have to admit i love this one… so please can i have more details about your frame ?? (dimensions, weight…)
thx!
Is the Quadruped source code still available for a $10 donation?
yes, sorry it’s £10
Hi Oscar,
How many servos are moving simultaneously in your project?
12 servos.
Hi Oscar,
I was interested in the code for a quadruped.
if you still have the code, please contact with me.
thank you very much
yes i do.
Hey Oscar,
Nicely done mate! Im working on a similar project for my robotic class this semester. What I am stuck on is keeping the creeper balance when walking. Whenever it walks for more than 4 steps, the body would start to collapse and sink from the middle =(. Any suggestion? And how long was your source code? did you code each individual legs with .attach () and .write () and delays? It will be really cool if I can refer your codes.
Thanks !
On what basis you are using 6V Ni-MH 4300mh Battery? I mean what are the calculations at the back end. how do we calculate the requirements for our battery?
Outstanding post however , I was wanting to know if you could write a litte more
on this subject? I’d be very thankful if you could elaborate a
little bit more. Cheers!
Hi Oscar,
Your blog is great! Me and my son are having a blast going through it looking for projects and he got really excited about the robot.
Is there any chance of getting your Quadruped Robot source code mentioned in the top of the page? (gait & IK programming is a little beyond us.. so would be great to see the code)
Going to be exciting to build one with my son using your code!
Thanks!
I have to say, I see your design almost two days without sleep, I really love it, and I learn to do quadruped robot for my son .but i study to do it just now,i really want to get your help.tks
Of course, let me know if you have any question and I will try my best :-D
thanks Mr. Oscar
I have received your source code, thank you for your willingness to help me, I admire your design, I will be concern what you do
Lilian
Hey oscar,
I have staretd the development of arduino based Quadruped robot for my college project.I initially started with the purchase of hardware like servo brackets,robot leg
and i purchased it at a very cheap cost compared to others.I purchaesd robot parts form
.I also bought the quadruped robot chasis for the same website .Its awesum and my full assembled robot is complete
and it looks perfect.Now i want to start with the programming of the same robot using arduino.I want to know which dimensional measurements of the robot to feed to the IK program
and if u can tell me according to your program which parameters i need to measure as per my chassis.If u show it in pictorial format i will be gratefu to u.
Thanks
please don’t spam my site! if you continue to spam with URLs, i will block you IP.
thanks Mr. Oscar,
we are working on quadrupped robot and we are done with the leg IK,i.e.finding Alpha ,beta ,gamma and we dont know how to get the body IK and relate it int full program…ur reply wil be appreciated
regards,
laximikant.
hi Oscar,
can u please tell me the steps to be followed in coding a quadrupped…like wat i understood by reading previous post that we should first callibrate the servos…so wat is the stepwise implementation….
regards
laximikant
1. decide on the frame, and then the servo, control board, battery…
2. assembling (servo + frame + electronics)
3. servo testing, make sure all servos are working as expected, and servo calibration.
4. implement Inverse Kinematics (IK)
5. with IK, you can implement body stretching (pitch, roll, yaw – moving center of body to all directions)
6. you can now try to implement gait
that’s all I have done so far, from here you can use your imagination, and do more advance stuff, like AI, object avoidance etc…
Hi Oscar, Would it perhaps be possible to get an explanation on how your balancing works?
Would it perhaps also be possible for me to send you some emails asking you about how some of your functions work? Just drop me an email if it is.
Thanks a lot
Hi Oscar,
Here’s hoping you’re keeping well. I’ve spent hours in your hexapod code since my last post on here. Things are coming along nicely. I’m turning my attention to your BodyBalance() function now. I’ve got everything else working ok at this point. I’d really appreciate a little explanation on the BodyBalance function. For example, I don’t see how TotalBal is used to do anything useful in the code. Also, how is that Quad code coming along? Can we expect a release sometime soon?:) I’ve tried making monetary contributions to your cause, but unfortunately I don’t have credit card facilities at this point. Any suggestions in that regard are welcome.
Thank you Oscar, always appreciate your efforts.
Kind Regards,
Martin
Hey, I got a ques plz
1-What is the torque of the servos? I’m using a 10 kg/cm^3 servos , is this torque enough?
2- Are u willing to attach a camera so that u can get a video stream or pictures? If yes, is it possible to use arduino for real time streaming? :/
3- I love ur robot’s legs :D did u make them urself? they are super nice, for me i’m planning to make the whole body on my own any advises? :D
Hi,
1. Those servos are hitec mg645. it’s about 9 kg/cm^3, but it’s already a over kill for this kind of robot.
2. Arduino can’t be used for video streaming (not even pictures), because it’s not powerful enough. You will need a separate system to handle that type of business, e.g. a smart phone, or raspberry pi.
3. those legs are actually very rubbish! it’s kinematically restrained. I am looking for a better design. You can DIY it, I would suggest 3D printing, it could save you a lot of time. or if you have a laser cutter, you can use some other stronger and cheap materials.
Hi Oscar, Is there any chance that you could post your source code?
I would like to see how you implemented the gaits.
Have you managed to get the creep gait to be able to not just walk in a straight line yet?
Yes! I will do that.
perhaps in a couple of weeks because i need to find the time to clean the code and add comments (so i don’t get blamed :( )
I haven’t looked into gait transition yet, but i will post the code before i do that so you don’t have to wait another year haha
Oscar, you’ve done an incredible job here! I’ve been most grateful for your comprehensive tutorials and other tips. I’m a final-year electronic engineering student and my Quad uses the Arduino Mega and an SSC32 servo controller. I’ve been converting somebody else’s hexapod code for use with a quaduped and the SSC32 but it has been rather problematic. I actually think they have used snippets of your code! Yours is that good:) Your hexapod code is seemingly more suitable for conversion and use in a quad with an SSC32. Are you sharing your quadruped code? I have a vision system which is taking plenty of my time to get working at the moment and would be keen to see how well it would integrate with your quad code. If not, I’ll continue wading through your hexapod code:) Thanks again, and keep up the great work!
Martin
Hi Martin, thanks for the kind words.
I can share the code with you that’s fine, I know how much it would help with your final year project because I had been there before myself!
I will put a download link in the post in a week or two, just after i clean the code and add comments.
i will email you to let you know.
regards
Oscar
Oscar, thank you kindly for that. I really appreciate it!
Hi Oscar,
Kindly let me know when you receive my donation. Here’s hoping you’re well Oscar.
Regards,
Martin
Hi Martin, thank you very much and yes I received your contribution!
I am currently working very hard on my second/third websites and not have much time spent on robots!
but should be back to it soon!
I hope you are doing well too.
Regards
Oscar
Hello, first let me express my admiration for ur project, I really like it and i’m aiming to make a similar one as my graduation project with android app to control it + a camera for face detection,i have some question plz.
did u use a servo controller circuit or u plugged the servos directly to arduino mega? (this confuses me alot as i see other projects using a servo controller circuts that costs a fortune!)
where is the power source that u used? i’m not seeing any battery in the pics :D
Thank you!
I connected everything directly to the Arduino Mega, but you will need external power source for the servos, so no servo controller is required.
Battery is a 6V NiMH Battery, it’s inside the body (under the arduino). You can also use LiPo, it’s lighter but less capacitance and more expensive.
Your robot looks great! I am trying to modify your hexapod code to work with a quadruped as you have done here but I am seeing a difference between the two GaitCalculate functions. In your hexapod code you pass in a coor object called WalkLength and use the x y and z values determined by nunchuck. In your quadruped GaitCalculate you just directly use the walklength variable. Could you explain more how these two variants differ and why? Thanks for the help in advance and for sharing your awesome project!
Thanks Brian!
that’s a good question. I am using WalkLength as a variable (literally just the z direction) because I still don’t know how to turn turn right or left during walking forward with this gait (creep gait), so I have ignore the x input (going right or left). How embarrassing…. ;-p
But for Trot Gait (the last video, or third video), I used the same the same WalkLength variable as the Hexapod (a coordinate).
So yea, WalkLenghth input should awlays be a coordinate… hope that make senses..
Hey Oscar,
After reading Brian’s comment regarding the variable WalkLength, and your comment about WalkLength always being a coordinate, I have a question.
I get an error “no match for ‘operator/’ ” when I leave WalkLength as a variable as follows:
GaitPos[LegIndex].Z = WalkLength/2;
However, when used as a coordinate:
GaitPos[LegIndex].Z = WalkLength.Z/2
Then I have no problems in terms of compiling. May I do this? I’m not sure what I’m missing since Brian didn’t seem to have a problem using WalkLength as a variable or a coordinate. All I have done is replaced the hexapod “GaitSelect” and “GaitCalculate” with your quadruped versions of those functions. Your assistance is appreciated as usual.
Kind Regards,
Martin
Hi Martin,
It depends on what variable you use to get the input.
If you declare “WalkLength” as int, you should be using
GaitPos[LegIndex].Z = WalkLength/2;
If you declare it as coor (a data type I define in a separate library file), then you should use this
GaitPos[LegIndex].Z = WalkLength.Z/2;
Yes, from the video I posted, I pretty much copied the code from the hexapod robot, so you are doing the same thing as I have done so far.
But there is something extra we should do with Quadruped robot. Because the COG (center of gravity) has to be inside of the tripod (formed by the 3 landing legs) before the other leg can lift. We need to have a function that makes sure of that, and tells the quadruped robot to shift the body toward that point to maintain balance.
Of course that could be the next step forward if you get the quadruped robot moving walking.
Regards
Oscar
Hey Oscar,
Could you please post your entire source code for both of your gaits? That would be awesome! Thank you!
I should’ve mentioned before. We are trying to make an autonomous quadruped for a senior project. We have been having a lot of issues with our project so far (like getting a properly stable frame, finding the right type of servo controller, etc) We solved these issues but now we are stuck on the gait with only a couple weeks left before our deadline. For now, we would appreciate it if we could get it to walk by typing commanding into the serial command window in the Arduino program. Is there any way that we can:
1) get you source code for the quadruped
2) get some helpful tips for how to use this code without having the nunchuck?
We greatly appreciate your help and how well organized your code is. Thank you
Jodgey
PS… We are using an Arduino Uno
congratulation on your walking quadruped.
Could you post the code or the algorithm you use for walking.
or a bit explanation on how you choose angles.
I read your IK post but I don’t quit understand on how to apply them.
Thanks
i will reply on the other comment you sent me.
thank you.
Hey Oscar,
Is it possible to get your measurements for your frame?
body length (leg to leg distance): 12 cm
coxa length: 2.9 cm
femur length: 5.7 cm
tibia length: 14.1 cm.
Hi Oscar. First of all congratulate you four your extraordinary work with this quadruped robot. I’m working in a quadruped robot too, and i am wondering if you can explain me the mechanic part, i mean the design of the legs and how you fixed the servos to the body and the legs.
Sorry for my bad english and thank you!