Robot Forum Archive

Some old backup of my previous wordpress forum about robots

  • Hi Oscar
    I’ve been following your blog about IK and hexapods that I find it excelent and very instructive.
    I’ve just made a donation so that you can keep up the good work and would like to obtain your hexapod source code as well as the Arduino bluetooth control application.
    Best regards
    Michele America

    • September 22, 2013 at 10:44 pm#2035EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)Thank you Michele!
      I will send you both source code shortly.
    • November 1, 2013 at 7:34 am#2402EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
      Member
      (122.111.253.136)Hi Oscar
      Thanks for a great work on Hexapod and Quadruped.
      I’d like to get your codes for my Quadruped by donation and I have questions:
      1. Do you have code that can move robot without remote controller?
      2. As my robot is larger than yours, I’ll need to use your xcell worksheet to calculate angles. Can your code be easily modified to enter my data?
      3. Can you provide a simple drawing how your servos are orientated against the front of a robot? If my servos are mounted differently than yours, then robot will make a senseless/crazy movements. Am I right?
      Thank you
  • September 23, 2013 at 8:41 am#2040EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (93.17.236.200)Thanks OscarGot the files this morning.

    Regards,

    Michele

  • November 1, 2013 at 7:54 pm#2415EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (2.29.41.129)In your code pins 23 to 41 are attached to servos.
    Is there some mapping e.g.
    RF coxa servo is connected to pin 23. etc.
    RM coxa servo is connected to pin 27?
    RR ……Kevin Kerr

    • November 7, 2013 at 10:46 am#2450EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (217.154.158.235)Hi Kevin, that’s right!
      If i am not remembering it wrong, 23 is RF coxa, 24 is RF Tibur, 25 is RF tibia, 26 is RM coxa, 27 is RM tibur, and so on… (legs are arranged in clockwise order)
  • November 10, 2013 at 1:46 am#2460EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (122.111.254.148)Hi Oscar,
    I’ve asked a few questions previously, but no answer from you.
    Can you pls clarify for me the following issues as I’d like to donate and get a code for quadruped.1. Can quadruped run without remote controller?
    2. Can I easily modify the code by entering data calculated with your excel?
    3. How your servos/servo horns are orientated against the body?
    can you provide a simple drawing?

    thanks

    • November 12, 2013 at 12:49 am#2477EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)Hi Sanoksorry for the delay in replying, i don’t get notification from the forum (still don’t know how it works) when people ask questions.

      to answer your questions:
      1. Yes it can, but the code needs to be modified.
      2. not sure what you mean, could you explain?
      3. I drawn a very rough picture for you, all legs have the same orientation, i I only drawn one leg. hope it makes sense
      https://oscarliang.com/ctt/uploads/2013/03/quadruped-robot-servo-horn-orientation.jpg

  • November 12, 2013 at 1:36 am#2480EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (122.109.116.41)Thanks Oscar,
    Re:2.
    My robot is different size, different coxa, femur, tibia lengths.
    Will your code work as is or do I need to make calculations using your quadruped excel worksheet and apply results to the code? If so, how easy or difficult that would be for a newbie?
    Re:3.
    So going clockwise starting from the leg you’ve drawn the femur and tibia servos will be always on the same side of the leg?

    • November 15, 2013 at 12:01 am#2495EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)Re2
      To be honest, if you don’t have the exact same hardware, it will most likely need some modification in the code. I can’t guarantee it will work for your robot, I don’t expect it will be working easily either, the main benefit of seeing my code would be learning how this algorithm works, and helps you to develop your own.Re3
      that’s right, i personally find it easier to work with. some people like symmetric legs, it’s down to your personal choice.

    • November 15, 2013 at 4:31 am#2496EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
      Member
      (122.109.127.161)Good idea to learn and develop own code, only if I can understand yours.
      Anyway I’ve just donated.
      thanks
  • November 21, 2013 at 10:00 am#2545EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)I have sent you the code now Sanok!

    • November 23, 2013 at 3:57 am#2585EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
      Member
      (122.111.252.244)Thanks Oscar,
      Wow this is unlike anything I’ve seen when it comes to arduino robot codes.
      Looks like a long learning curve.
      The code doesn’t compile.
      Getting error message: ‘byte’ was not declared in this scope
      and line is highlighted in nunchuck library:
      static uint8_t outbuf[WII_TELEGRAM_LEN]; // array to store
      also this line highlighted in the main code:
      if (NunC_RecieveCommand() == true){Do I need to install WPogram.h, string.h, utilitytwi.h, stdio.h ?

    • November 24, 2013 at 11:41 pm#2587EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)Oh sorry SanokI forgot to mention that because I started this project more than 1 year ago, so I was using older version of Arduino IDE (0023) for compile.

      Anyway, it’s easy to download it from here. Just search for 0023

      http://arduino.cc/en/Main/OldSoftwareReleases

      Try that IDE first, if you are still getting errors, please let me know!

  • November 29, 2013 at 1:20 am#2602EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (122.111.248.45)OK, it compiles now
    thanks Oscar
  • November 29, 2013 at 2:40 am#2603EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (122.111.248.45)Hi Oscar,In the fmath.h in const float there are 91 and 51 values listed.
    Are thees calculated according to your robot dimensions?
    If so, how to calculate them?

    • November 29, 2013 at 9:11 am#2604EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (217.154.158.235)Great!
      The pre-defined array with 91 values is just data from the first quarter of a sine wave ( values of sin(0) to sin(90) ).
      the 51 array is the values of acos(0.8) to acos(1)This is an universal maths library I used for all my robots, so should work for you too. But you can write your own math lib or just use the Arduino one if you want.

  • November 30, 2013 at 3:41 am#2606EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (122.111.250.188)Hi Oscar,I was trying to attach my 12 servos which are between pins 2 and 13 (Arduino Uno), so I’ve modified your code:

    // —– IK ——-
    for (int i=0; i<12; i++){
    legServo[i].attach(i+23);

    to this:

    // —– IK ——-
    for (int i=0; i<12; i++){
    legServo[i].attach(i+2);

    Should I expect servos to go and stay at certain position ( not being able to turn them by hand) or should I be able to push them freely as if they’re not attached?
    Please note that nunchuck is not connected yet (as I don’t have one as yet)
    When I power arduino “on”, the servos move freely by hand as if not attached.
    thank you

    • November 30, 2013 at 8:59 am#2607EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)No, once you have initialized it them (“attach” the servo, and “write” a initial position), you WILL NOT be able to turn them by hand, the position is fixed.if you can turn them by hand, if probably means there is something wrong with the power source to the servos, or they are not initialized properly.

      just one question, how are you powering the servos? What battery are you using?

  • November 30, 2013 at 3:44 pm#2608EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (175.38.163.223)Servos are connected to breadboard for power, battery is 7.4v 2200mAh.
    Robot walks OK using another simple code
  • December 30, 2013 at 3:33 pm#2782EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (216.167.174.66)Hi Oscar!I donated the £10 pounds requested and would love a copy of your code — I think I understand how it works, but really want to see an implementation -why re-invent the wheel, lol!

    I’ll need to heavily modify as I’m using a pair of these to run my servos:
    I figure using these makes the power management easier.

    • December 30, 2013 at 3:53 pm#2783EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (217.154.158.235)Hi Olestracould you tell me the date of donation and your name used in your paypal account so I can confirm it?

      you can send me these information through the private message if you want:

      About

  • December 30, 2013 at 4:05 pm#2784EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (216.167.174.66)PM sent, your response was wicked fast!
  • January 11, 2014 at 6:23 pm#2813EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (223.19.201.216)Hi Oscar!I’m working on a project which is a hexapod robot with 18 no. of servo and controlled by arduino mega 2560. I wanna ask a stupid question. Can the arduino sensor shield V5.0 able to control 18 no. of servo and 6 no. of force sensor? If not which one are recommended?

    Thanks.

    • January 12, 2014 at 12:40 am#2814EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)Hi,
      isn’t the Arduino Sensor shield for the Arduino Uno?
      Not sure if we are talking about the same one, as long as the shield provide access to at least 18 digital pins (3×6), you should be fine.I couldn’t find any good ones, so I made one myself. You can find out more from my hexapod robot post.

  • January 12, 2014 at 5:42 am#2815EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (223.19.201.216)Allow me to ask more detail. Each of servo and force sensor require 1 set of GVS (Ground Voltage Signal) to control its. Therefore, 18 x servo and 6 x sensor require 24 no. of GVS pin. Is that right?I’m a newbe of robotic control and thanks for your help.

    • January 12, 2014 at 7:48 am#2816EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)they can all share the same G and V, so what you really need to be careful about is the number of Digital and Analog pins that you can access to, when choosing a good Arduino shield.Some sensors uses Analog pins, just be aware. Welcome to the robotic world

  • January 12, 2014 at 4:00 pm#2817EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (223.19.201.216)I just buy a MEGA sensor shield V2.0 today. And trying to write a program to control the force sensor and servo motor.
  • February 5, 2014 at 7:46 am#2909EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (223.19.200.99)Hi Oscar,I’m working on the servo programming from a initial angle to final angle by using third order equation. I success to write the code from e.g. 90 > 120 and 120 > 90 respectively, but I don’t know how can link its together from 90 > 120 then 120 > 90 in the arduino programming.

    a0 = initial angle
    a1 = 0
    a2 = (3/tf^2) * (initial angle – final angle)
    a3 = (-2/(tf^3)) * (initial angle – final angle)
    angle = a0 + a1*t + a2*t^2 + a3*t^3

    tf: final time

    As you see, from initial angle to final angle I need to reset the “t” to “0” and give the initial and final angle to above equation to calculate. I think it’s difficult to understand, hope you can get what I mean.

    Thanks.

    • February 9, 2014 at 1:57 pm#2924EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)sorry, i don’t quite get what you mean, and what you are trying to do??
  • February 11, 2014 at 1:38 am#2969EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (121.202.4.206)Hi Oscar,Sorry for my bad English and explanation. The problem has been fixed and now I’m concentrating on the inverse kinematics model.

    Thanks

  • February 23, 2014 at 4:04 pm#3068EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (122.111.243.99)Hi Oscar
    I’ve connected wii nunchuck to my quadruped and was trying to walk it, but its movements don’t make any sense. This is probably because servos are not positioned exactly like yours. Which part of the code do I need tweaking to compensate for servo horn positions?
    Are your servos starting position 90 Deg plus offset? (assuming you using 0-180 deg )thanks

    • February 24, 2014 at 1:47 pm#3069EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (217.154.158.235)Hi SanokIn the code, the legs’ initial coxa angels are set by array “AngleOffset”, such as 45, 135, 255, 315.

      Each servo are fine tuned by this array “servoOffset”, which is in micro second (600-2400 micro second = 0-180 degree)

      There is one more variable that can affect the initial leg position, which is “LegOffset”, it changes the end point position of the each leg, while maintaining the height between leg end point and coxa. (note that this is in milli meter)
      – When LegOffset=0, femur and tibia should be 90 degree (0-180 scale)
      – When LegOffset <>0, leg end points move out or in, and it changes femur and tibia angles

      To better troubleshoot the issue, make servoOffset array all zeros, and LegOffset zero as well.

      hope that makes sense. If you are still having problem, try to upload a video, it could help us identify what the problem is.

    • February 26, 2014 at 6:54 am#3072EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
      Member
      (175.38.162.27)My nunchuck just died as the Arduino Uno analog pins provide 5V, which can destroy nunchuck as I’ve read somewhere. So have to wait for new one.
      Next time will connect separately to 3.3V
      Oscar I was trying to use your wii nunchuck test program from your wii nunchuck tutorial page but it doesn’t compile, getting message:
      “NunC_print” was not declared in this scope (Arduino 0023)
      and:
      “NunC_RecieveCommand” was not declared in this scope (Arduino 1.0.5)

      #ifndef NUNCHUCK_H
      	  #define NUNCHUK_H
      	  #include <Wire.h>
      	  #include "nunchuck.h"
      	#endif
      	 
      	void setup(){
      	 
      	    Serial.begin (19200); // Required by Wii Nunchuck
      	    NunC_Init(0); // initialize nunchuck
      	 
      	}
      	 
      	void loop(){
      	 
      	    if (NunC_RecieveCommand() == true){
      	 
      	        NunC_print ();
      	 
      	    }
      	    NunC_SendNextByteRequest(); // send the request for next bytes
      	    delay(10);
      	 
      	}
      
    • February 27, 2014 at 12:00 pm#3073EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (217.154.158.235)sorry, the code was messed up by the my blog plugins!
      i have updated the correct code, please try again.
    • March 1, 2014 at 3:06 am#3098EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
      Member
      (175.38.162.33)Oscar,
      the code at the bottom of “Wii Nunchuck Tutorial” page is still the same and doesn’t compile, so which code did you update?
      thanks
  • September 11, 2014 at 9:09 pm#3879EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (77.177.197.165)Hello oscar,Great site!!! I have just finished a project and wanted to post in your forum but after regestering i still can’t find a link for a new thread.
    please advise.

    kind regards
    luke

    • September 12, 2014 at 9:40 am#3880EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (217.154.158.235)that’s Great Lukeyou can start a new thread by going to a forum, e.g.

      scroll down to the very bottom, you should see the form for new thread.

      R.G.
      Oscar

 


 

  • June 12, 2014 at 2:41 pm#3464EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (143.53.153.190)Hi Oscar,I am currently working on rectangular type of hexapod (MSR-H01/Phoenix), but I am a bit confuse with some of the variables in Leg IK. Could you please help me to confirm if I understand the variables correctly?

    RB_FeetPos –> from center of body to the end of tibia tip?
    RC_FeetPos –> from coxa to the end of tibia tip?
    AngleOffset[6] –> angle offset of each leg, origin is located at center of body or coxa?

    And also, what does this part means in the code?

    RC_FeetPos.X = RB_FeetPos.X * fcos(angleOffset) - RB_FeetPos.Z * fsin(angleOffset);
      RC_FeetPos.Z = RB_FeetPos.X * fsin(angleOffset) + RB_FeetPos.Z * fcos(angleOffset);
      RC_FeetPos.Y = RB_FeetPos.Y;

    I really appreciate if your could give me some help. Thanks in advance.

    regards,

    Jeremy

  • June 13, 2014 at 4:48 pm#3467EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)Hi JeremyFor your first question, yes, that’s right.
    AngleOffset[6] is the angle between Z axis and the leg as you look down from above along Y axis, origin is the centre of the body.

    About that code snippet, it’s the coordinate transformation, from one axis system to another.

    Remember you have an angle offset for each leg? each leg has a rotation angle from the body, you need to apply the rotation to the local axis system, origin from each coxa.

    Sorry I am very bad at explaining things, it’s been a while I haven’t worked at this project. Check out this post: https://oscarliang.com/inverse-kinematics-implementation-hexapod-robots/

    find the section “Improvements – Coordinate Transformation”

    Cheers
    Oscar

  • June 13, 2014 at 7:00 pm#3469EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (82.219.184.65)Hi Oscar,Thanks for the explanation. I think I have just able to sort that part out today. However, another problem comes when I trying to work with the gait calculation.

    I have seen your other post in blog.oscarliang.net/forums/topic/new-gaits/ and I am trying to understand what is each of the if..else doing in “GaitCalculate()”.

    Would you mind to explain to me why sometimes you use sin(80), sin(20), sin(30) etc..?
    It would be great if you could provide me a short summary of what is each of the if..else.. doing.

    GaitPos[LegIndex].X = -WalkLength.X / 2 * FSIN_TABLE[80];
    GaitPos[LegIndex].Y = -LegLiftHeight * FSIN_TABLE[20];
    

    Thanks again.

    Regards,
    Jeremy

    • June 14, 2014 at 12:15 am#3470EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)When creating the gait algorithm, my idea was When walking, the legs have 2 states:
      1. leg lifts, move from point A to point B, lower leg on ground.
      2. leg stays on the ground, and shift back, as if the body is moving forward.So, I use if… else… to determine the state of the leg.
      However, we have many “else if” too, why?

      basically, the “if” and “else if” are case 1, the “else” is case 2.
      You might ask, why not just one “if”, and one “else” to represent the two states? That’s because when the leg is lifted, moving from point A to point B, you want it to move in a curve, like 1/2 of a sine wave, which looks more natural. Each “else if” is a point in the curve, the more points we have (more “else if”), the smoother the leg moves.

      That also explains why sometimes I use sin(x) with different X degrees, they are points in a sine wave.

      Note that not every “else if” is used in a gait, the number of else if used is specified by “StepsInGait” and “TLDivFactor”.

      Hope that makes sense.

  • June 23, 2014 at 1:52 am#3514EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (82.219.184.65)Hi Oscar,
    Thanks for your patience and explanation. Finally I have able to sort it out and make it work as what I want.By the way, would you mind to send me your code for the android controller?

    Thanks in advance and really appreciate your non-lasting help.

  • June 25, 2014 at 9:31 am#3515EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)that’s great!
  • July 28, 2014 at 2:36 am#3605EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (197.83.233.185)Hi Oscar,I am trying to implement your code on a lynxmotion phoenix chassis. The servos are mounted symmetrically i.e. they all point forward when in standing position, unlike yours which are mounted circularly.

    The servos have the same pin configuration as yours. I suspected that only the updateLeg() function needed changing. But I’ve tried to manipulate it and still no luck. Can you help please help me.

    Thanks

    • July 28, 2014 at 9:56 pm#3608EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)- you will need to measure the dimension of your body, legs, and update those in the code.
      – if you want to have a different initial leg position, you just need to change the angle in setup() function (search for [INITIAL LEG POSITIONS] )
      – there is no need to change UpdateLeg() function.————————————-

      I strongly recommend that you write a new sketch for your robot, my code can help you understand how my robot works, and can be a reference, but I doubt it will work straight away on your robot, since the conditions are different.


 

  • February 9, 2014 at 12:08 am#2922EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (87.188.235.138)Hi Oscar,
    hi all,please tell me where I must connect the servos. I’ve no idea which servo I’ve to put to which pin.
    And I’ve found nothing in the source and in Your blog. May be it has to do with my terrible English.
    At last ist will be helpful to know whih position of each leg is the default position?

    Thanks and Greetings
    Kai

  • February 9, 2014 at 1:53 pm#2923EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)Hi Kai,the Servos should connect to the digital pin, and should be powered by external battery. Any digital pins can be used, and defined by user in the source code.
    The source code is currently only available for people who donates to my project, the detail can be found at the bottom of the article.

    thanks
    Oscar

  • February 9, 2014 at 1:58 pm#2925EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (87.188.235.138)Hi Oscar,thanks for Your answer. I’ve already donated and I’ve already the code from You on 16th Jan 2014.
    But I’m not able to find the pin numbers for the legs. I’ve 3 servos for each leg and I think each of the 18 servos must be on a defined position connected.
    The second question was that in may be helpful to know which position of each leg is the default position?

    Thanks
    Kai

  • February 11, 2014 at 1:56 pm#2996EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (194.138.39.59)Is there anybody out there who can help me?

    • February 11, 2014 at 3:21 pm#2997EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (217.154.158.235)Hi, sorry about the delay in replying.you can find the servo pin are defined this way in my code:

      	// ================  Servos  ==================
      	for (int i=0; i<18; i++){
      		legServo[i].attach(i+23);
      		delay(10);
      		legServo[i].writeMicroseconds(1500+servoOffset[i]);
      		delay(100);
      	}
      

      because I am using pin 23 to 41, it’s cleaner this way if you use 18 continuous pin numbers. otherwise just define each servo on the pin you want explicitly.

      ——

      Default positions can also be found in the for loop above, which is 90 degree + a offset defined in the array.

  • February 11, 2014 at 3:55 pm#2998EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (194.138.39.59)Hi Ocscar,thanks for Your answer. I can follow You with the array. Is it right, that the 1st servo is the coxa, the 2nd is the femur and the 3rd is the tibia and the 4th starts again with the coxa and so on?

    With the default position I meant the hardware positions of the legs. Before screwing together, each servo was set to its hardware default position. Then I’ve done it in this way:
    The coxa servos stay something like this:
    ___/_
    _–0–_
    _/___
    All femur plastic arms stands horizontally and all tibia stands vertically. Is this OK?

    Greetings
    Kai

  • February 11, 2014 at 4:40 pm#3000EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)Yes you are right.To clear things up, the legs are arranged in clockwise order.

    For example, pin 23 is RF coxa, 24 is RF Tibur, 25 is RF tibia, 26 is RM coxa, 27 is RM tibur, and so on…

    (RF – Right Front, RM – Right Middle and so on)


 

  • December 3, 2013 at 3:40 pm#2659EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (60.52.55.126)Hi Oscar,
    I’m impressed on the work you had done, especially on the IK.
    Noted that the equations you had written for the IK is based on the leg perpendicular to the plane (floor, in this case). How do you determine the angle when the body slant to one side ?? I believe the legs will slant accordingly.Regards
    Gary

  • December 4, 2013 at 12:59 pm#2663EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)Hi Garythis is a common question.
    when you are slanting the body, think of the center of the body as the reference point, and are you just moving the tip of the leg.

    Which means, you would have to work out the angles of each servo , before you can move the legs.

    Hope that makes sense.
    Oscar


  • October 7, 2013 at 1:58 pm#2120EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (93.17.236.200)Hi Oscar
    Could you please help me out with this… I want to add more gait types to the robor but I’m not quite sure how the gaits work in your code.If you could explain how it works and supply with an example, even if simple, of how must I do do add a new gait.

    Thanks in advance.

    Michele

  • October 10, 2013 at 12:02 pm#2150EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)Hi Michele,==================================

    This is how the Gait works and movement is generated:

    Basically while walking, the legs have 3 states:

    • lift leg (and move forward the leg depends on user control)
    • put down leg (and move forward the leg depends on user control)
    • move the leg backward on the ground

    These are all in this function:
    coor GaitCalculate (coor WalkLength)

    Each if statement is a state (although there are more than 3 if statements, because there are multiple “if” for the same state to create a more natural movement, but not all if statement are used)

    ==================================

    How you can create a new gait?

    you can do this by editing variables in this function.

    void GaitSelect (){
    //Ripple Gait 18 steps

    GaitLegNr[LR] = 1;
    GaitLegNr[RF] = 4;
    GaitLegNr[LM] = 7;
    GaitLegNr[RR] = 10;
    GaitLegNr[LF] = 13;
    GaitLegNr[RM] = 16;
    NrLiftedPos = 3;
    TLDivFactor = 12;
    StepsInGait = 18;

    }

    GaitLegNr[] – This is the step number for each leg in the gait sequence.
    NrLiftedPos – This is the maximum number of leg lifted in the air at the same time (sychronised and assynchronised)
    StepsInGait – Total steps in a gait sequence (for a leg to move one cycle)
    TLDivFactor – Total number of step that a leg is on the ground. (= StepsInGait – Steps in the air)

    ====================================

    Here is an example for 4 step Tripod Gait (lifting 3 legs at one time)

    GaitLegNr[LR] = 3;
    GaitLegNr[RF] = 1;
    GaitLegNr[LM] = 1;
    GaitLegNr[RR] = 1;
    GaitLegNr[LF] = 3;
    GaitLegNr[RM] = 3;
    NrLiftedPos = 1 ;
    TLDivFactor = 2 ;
    StepsInGait = 4 ;

    ====================================

    You can actually have many gait settings in the “GaitSelect()” function, and use if statement to choose a gait while robot is on.


 

  • September 21, 2013 at 12:38 pm#2006EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (82.66.233.245)Hi OscarI have a doubt regarding the way an hexapod should be assembled to be conformant to your ik equations.

    How should he coxa, femur and tibia should be attached to the respective servos when they are in position 0 degres or 1500usec pulse. Should everything be assembled in an orthogonal way with all limbs strictly following the 0 degrees direction for each servo ?

    Thanks in advance

    Michele

  • September 23, 2013 at 8:40 am#2039EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (93.17.236.200)Thanks for the info OscarAnd about the hexapod legs, do you have the servos attached to their respective leg parts while in neutral position (0°) such that if all servos are commanded to 0° the hexapod is flat down on his belly with the legs 60° apart and streched?

    Regards

    Michele

    • September 23, 2013 at 10:47 pm#2049EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
      Keymaster
      (81.108.179.49)not really… at neutral position (all servo at 0 degree), it’s like this

       __ [ Body ] __
      |              |
      
      

      and each leg are 60 degree apart.

      That’s because I use 90 to -90 scale instead of 0 to 180.
      But it does make sense to have 0 degree as the starting position, so you can get the robot to stand up (seen that in many times in youtube videos)

  • September 22, 2013 at 10:54 pm#2036EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)Hi MicheleMy leg configurations are symmetric, meaning they are 60 degree apart.

    You can have other configurations like the Phoenix. These can be changed in the variable initialization section, Body Dimension, “AngleOffset”.

    regards
    Oscar


 

  • August 26, 2013 at 8:19 pm#1842EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (217.83.58.53)Hi Oscarin your robot projects you are not using external servo controllers.
    When I try to drive 12 servos directly they sometimes reset the arduino.
    It seems that the ground connection knocks it out.
    Do you have any hints on this topic?

    Max

  • August 26, 2013 at 9:45 pm#1843EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (95.149.248.162)It’s most likely to be the power supply. I have found at full load just one of my servos can get upto 1amp draw. If you have a digital ammeter you may be able to get it to automatically lock at peak current draw to see what’s actually getting used.J

  • August 27, 2013 at 10:59 am#1845EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)I tend to agree with J, 12 servos can draw quite a huge amount of current.what servo have you got and what battery are you using?

  • August 27, 2013 at 12:22 pm#1850EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (79.238.187.168)The servos are really cheap ones from Hobbyking:http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=16269

    and the battery is a 3300mah 6V sub-c pack.
    It is working right now so maybe there was a short circuit somewhere else.

  • August 27, 2013 at 12:44 pm#1852EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)Great it’s working nowYou might be interested in this post. This is quite a good post how to work out the max current output from the C value and capacity of the battery


  • August 26, 2013 at 7:38 pm#1841EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (95.149.248.162)Oscar, I have implemented your 14 Aug 2012 code as is. Whilst I get to grips with then movement algorithms ( I’m a visual learner ) is it possible to control simply directly to the arduino comport via Serial Monitor ( telnet, putty etc ) You mentioned sending 2 4 or 6 bytes but looking at the code it has cases e.g. case 122 which is ascii ‘z’ so sendingz = movement direction
    9 = x distance ( what value is it e.g mm or steps )
    9 = z distance
    3 = speed

    so sending command via telnet z993 should make the robot walk diagonally at speed of 3?

    … or am I completely misunderstanding the code?

    also could i please get a copy of the android app source, I think that would clarify most of the control

    Many thanks

    J

  • August 27, 2013 at 10:50 am#1844EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)Hi J,the robot was controlled using a Android phone via bluetooth, so I was trying to cut down the size of the command packet (controlling only 1 thing at 1 time).

    you can use serial monitor if you want, but you can imagine the input frequency will be very low… To achieve smooth and natural movement, continuous, frequent and gradual inputs is quite important. (At least it is to my design) The input frequency was probably 2 to 3 times per second.

    if you are going to use serial monitor for input, maybe you can use a buffer array, so you can average inputs, to simulate a series of gradual, continuous changing inputs?

    I also have a version for wii nunchuck controller if you have one too?

  • August 27, 2013 at 11:58 am#1848EDIT | MOVE | SPLIT | TRASH | SPAM | REPLY_Visitor _Visitor
    Member
    (95.149.248.162)Oscar can you please send over the SC for the android app, since i was kind enough to send some sponsorship
  • August 27, 2013 at 12:08 pm#1849EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)Yes, of course!

  • August 17, 2013 at 1:41 pm#1786EDIT | CLOSE | STICK (TO FRONT) | MERGE | TRASH | SPAM | REPLYstephane
    Member
    (77.204.97.81)Hi Oscar,
    I just saw that you have a forum so I moved my comment here, exuse me ^ ^, after a long vacation, I finally finished the structure of my hexapod, I give you pictures, what do you think? I’ll change the batteries and improve cable management!
    for programming with Arduino I’m really a beginner, can you help me? because I do not know where to start! I would like to drive with a wii nunchuk.
    thank you soon.

    http://zupimages.net/up/3/642078016.jpeg

    http://zupimages.net/up/3/1594015566.jpeg

    http://zupimages.net/up/3/2119962959.jpeg

  • August 18, 2013 at 12:02 pm#1788EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)looking Good Stephane!Sure I can help you with the programming. As a start, I think it’s better to write some functions that do the routines, for example, rotate the body, lift the legs, put the leg down … etc etc…

    To use nunchuck, have you seen my tutorial:

    Wii Nunchuck Arduino Tutorial

  • August 18, 2013 at 12:25 pm#1789EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.204.97.81)thank you for you answer, I’ll go read your tutorial for the nunchuck immediately ^ ^ if not for the basic functions you have to porgrammer example so that I can understand and aprendre programming arduino for my hexapod, if that you do not mind sharing with me your codes?
  • August 18, 2013 at 2:00 pm#1790EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)Sure, here is the code for my 2DOF hexapod robot. But I don’t know how useful this is to yours.https://dl.dropboxusercontent.com/u/457167/Blog_Download_Resources/HexBot2DOF.zip

    From the videos you can probably tell how it’s controlled (via Serial Monitor, or the VB application)

    Here is my post for this robot

    If you want to control it using wii nun chuck you will have to write completely different code.

  • August 18, 2013 at 2:06 pm#1792EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)My suggestion would be, read through the nun chuck tutorial, you just need to know how to use the library, don’t worry the programming.And then write some simple functions to control a leg, you will get more familiar with it. And then extend it to more complicated stuff…

  • August 18, 2013 at 2:37 pm#1793EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.204.97.81)Great, I will work on this, and I give you news very quickly, thank you
  • August 18, 2013 at 4:13 pm#1794EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.204.97.81)I just read your tutorial for the nunchuk, how do I set library in arduino?
    I’m really sorry because I start in robotics and I do not know the tips and tricks
  • August 18, 2013 at 4:28 pm#1795EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)no worries Stephane :)
    Basically, to use the library, you need to create a new tab in the Arduino IDE (there is a arrow icon on the top right => )
    name it nunchuck.hAnd copy and paste the source code in the tutorial, you should be good to go !

  • August 18, 2013 at 4:52 pm#1796EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.204.97.81)Here, new “nunchuk.h §” tab, I have to save it or it can become a library?and a big thank you for your help!

  • August 18, 2013 at 5:22 pm#1797EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)Yes, save it, and it will be accessible for the main program if you “include” it at the beginning.
  • August 18, 2013 at 7:23 pm#1798EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.204.97.81)I think I succeeded, so after I open Arduino to create a program and I have included the nunchuck library, and I get “# include <nunchuck.h>” if this is the beginning of everything?I think it’s really great to talk with you, it makes me want to continue this passion for robotics

  • August 18, 2013 at 10:53 pm#1799EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)it’s great to hear that
    take a small step at a time and you will get there.
  • August 19, 2013 at 5:02 pm#1800EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.201.33.100)hi oscar, I’m back at work ^ ^, so I for programming I have written at the beginning# include “nunchuck.h”

    What should I do next? in order to create life beyond my robot!

    I’ve also seen that you need a gift, I’ll see how I can give you so that you can continue your great blog

  • August 19, 2013 at 5:20 pm#1801EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)Have you tested the nunchuck, is it working?I don’t know how much you know about Arduino, you can use Serial.print(), to test the input of the nunchuck, make sure you are getting the input as expected.

    After you make sure it’s working, you can start playing around with the servos and legs. write some small functions that controls the legs, movements. e.g.

    liftLeg(legNum)
    landLeg(legNum)
    turnLeg(degree, legNum)
    .
    .
    .
    etc
    

    One example of using these little functions would be rotating the body, all legs are going to turn to the same direction:

    TurnBody(degree){
    
       turnLeg(degree, 1);
       turnLeg(degree, 2);
       turnLeg(degree, 3);
       turnLeg(degree, 4);
       turnLeg(degree, 5);
       turnLeg(degree, 6);
    }
    

    It’s totally up to your how to design and code your robot, and that’s the fun part of it.

  • August 19, 2013 at 5:33 pm#1802EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.201.33.100)thank you for your reply, I am really my first programing with Arduino (I ordered books for aprendre more)!
    no I have not tested the nunchuck because I do not really know how to do(I just like on facebook ^ ^)

  • August 19, 2013 at 7:20 pm#1805EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)okay not to worry, luckily it’s not very difficult to test it.I have added how to test the nunchuck in this post, go to the bottom of the post:

    Wii Nunchuck Arduino Tutorial

  • August 19, 2013 at 7:46 pm#1808EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.201.33.100)Very well, thank you for your help, I’m starting to learn, but I have a problem with the library, when I check if everything is good there is an error message, I do not understand my mistake!
    Otherwise, how did you learn the hard programming arduino ?http://zupimages.net/up/3/492463797.png

  • August 19, 2013 at 8:06 pm#1811EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)very strange error!
    one tip, try to use the older version Arduino software, I prefer to use Arduino 0023:http://arduino.cc/en/Main/Software

    Also try to copy the Nunchuck library again from the tutorial, i am not sure if it’s something to do with the code there, i have updated it now.

    =========

    To get better with Arduino programming, you should start with very simple things, e.g. control a few LEDs with a button, or a potentio meter.
    You don’t even need a book, google is your best teacher

  • August 19, 2013 at 8:24 pm#1812EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.201.33.100)so I started to make a 10 LED track, the code is simple, but after I do not understand the program, the program architecture and the values for a movement (servomotor), I downloaded the Arduino version and I’ll go to sleep because tomorrow I have a big day of work at my job, I give you news tomorrow night, and a big thank you for your help!
  • August 20, 2013 at 5:01 pm#1817EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.201.33.100)After you download Arduino 0023, I made the manipulation, and I still have the same error, I am discouraged, I will probably forget the nunchuck option =(
  • August 20, 2013 at 7:59 pm#1818EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.201.33.100)I go to the source code of the blog that you give your tutorial to test, it was accepted by Arduino without error, but your nunchuck programe test does not work with this library, I find it difficult to understand and all this beyond me XD
  • August 21, 2013 at 8:20 am#1821EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (217.154.158.235)you don’t need to understand the library… just need to know how to use it
    But Arduino programming is very simple to be honest, it just only takes time to get used to ithmm… not sure why the debugging didn’t work for you. i have changed it now maybe try the new solution again when you have time?

  • August 23, 2013 at 4:43 pm#1822EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYstephane
    Member
    (77.201.33.100)i oscar, I always error problem:In file included from nunchuk_h.cpp 1:
    / Nunchuck.h: 8:22: error: WProgram.h: No such file or directory
    / Nunchuck.h: 10:25: error: utility twi.h: No such file or directory
    In file included from nunchuk_h.cpp 1:
    nunchuck.h: 13: error: ‘byte’ was not Declared in this scope
    nunchuck.h: 13: error: expected `) ‘before numeric constant
    nunchuck.h: 13: error: expected `] ‘before’, ‘token
    nunchuck.h: 17: error: ‘byte’ does not name a kind
    nunchuck.h: 18: error: ‘byte’ does not name a kind
    nunchuck.h: 19: error: ‘byte’ does not name a kind
    nunchuck.h: 20: error: ‘byte’ does not name a kind
    nunchuck.h: 21: error: ‘byte’ does not name a kind
    nunchuck.h: 22: error: ‘boolean’ does not name a kind
    nunchuck.h: 23: error: ‘boolean’ does not name a kind
    nunchuck.h: 26: error: ‘byte’ does not name a kind
    nunchuck.h: 27: error: ‘byte’ does not name a kind
    nunchuck.h: 28: error: ‘byte’ does not name a kind
    nunchuck.h: 29: error: ‘byte’ does not name a kind
    nunchuck.h: 30: error: ‘byte’ does not name a kind
    nunchuck.h: 32: error: ‘byte’ does not name a kind
    nunchuck.h: 38: error: ‘byte’ does not name a kind
    / Nunchuck.h: In function ‘void clearTwiInputBuffer ()’:
    nunchuck.h: 64: error: ‘Wire’ was not Declared in this scope
    / Nunchuck.h: In function ‘void ConvertOutputs ()’:
    nunchuck.h: 93: error: ‘byte’ was not Declared in this scope
    nunchuck.h: 93: error: expected `; ‘before’ temp_JX ‘
    nunchuck.h: 94: error: expected `; ‘before’ temp_JY ‘
    nunchuck.h: 95: error: expected `; ‘before’ temp_AX ‘
    nunchuck.h: 96: error: expected `; ‘before’ temp_AY ‘
    nunchuck.h: 97: error: expected `; ‘before’ temp_AZ ‘
    nunchuck.h: 99: error: ‘temp_JX’ was Not Declared in this scope
    nunchuck.h: 99: error: ‘outbuf’ was Not Declared in this scope
    nunchuck.h: 100: error: ‘temp_JY’ was Not Declared in this scope
    nunchuck.h: 101: error: ‘temp_AX’ was Not Declared in this scope
    nunchuck.h: 101: error: ‘map’ was not Declared in this scope
    nunchuck.h: 102: error: ‘temp_AY’ was Not Declared in this scope
    nunchuck.h: 103: error: ‘temp_AZ’ was Not Declared in this scope
    nunchuck.h: 105: error: ‘NunC_BZ’ was Not Declared in this scope
    nunchuck.h: 106: error: ‘NunC_BZ’ was Not Declared in this scope
    nunchuck.h: 107: error: ‘NunC_BC’ was Not Declared in this scope
    nunchuck.h: 108: error: ‘NunC_BC’ was Not Declared in this scope
    nunchuck.h: 119: error: ‘NunC_JX_buf’ was Not Declared in this scope
    nunchuck.h: 119: error: ‘Bindex’ was Not Declared in this scope
    nunchuck.h: 120: error: ‘NunC_JY_buf’ was Not Declared in this scope
    nunchuck.h: 121: error: ‘NunC_AX_buf’ was Not Declared in this scope
    nunchuck.h: 122: error: ‘NunC_AY_buf’ was Not Declared in this scope
    nunchuck.h: 123: error: ‘NunC_AZ_buf’ was Not Declared in this scope
    nunchuck.h: 135: error: ‘NunC_JX’ was Not Declared in this scope
    nunchuck.h: 142: error: ‘NunC_JY’ was Not Declared in this scope
    nunchuck.h: 149: error: ‘NunC_AX’ was Not Declared in this scope
    nunchuck.h: 156: error: ‘NunC_AY’ was Not Declared in this scope
    nunchuck.h: 163: error: ‘NunC_AZ’ was Not Declared in this scope
    / Nunchuck.h: In function ‘void NunC_Init (short unsigned int)’:
    nunchuck.h: 180: error: ‘PORTC’ was Not Declared in this scope
    nunchuck.h: 180: error: ‘PORTC2′ was Not Declared in this scope
    nunchuck.h: 180: error: ‘_BV’ was Not Declared in this scope
    nunchuck.h: 181: error: ‘PORTC3′ was Not Declared in this scope
    nunchuck.h: 182: error: ‘DDRC’ was Not Declared in this scope
    nunchuck.h: 183: error: ‘delay’ was not Declared in this scope
    nunchuck.h: 187: error: ‘Wire’ was not Declared in this scope
    nunchuck.h: 192: error: ‘TWBR’ was Not Declared in this scope
    nunchuck.h: 192: error: ‘CPU_FREQ’ was Not Declared in this scope
    nunchuck.h: 194: error: ‘byte’ was not Declared in this scope
    nunchuck.h: 194: error: expected `; ‘before’ rc ‘
    nunchuck.h: 207: error: ‘millis’ was not Declared in this scope
    nunchuck.h: 210: error: expected `) ‘before numeric constant
    nunchuck.h: 210: error: expected `) ‘before’, ‘token
    nunchuck.h: 215: error: expected `) ‘before numeric constant
    nunchuck.h: 215: error: expected `) ‘before’, ‘token
    nunchuck.h: 220: error: ‘rc’ was Not Declared in this scope
    nunchuck.h: 224: error: ‘rc’ was Not Declared in this scope
    nunchuck.h: 229: error: expected `; ‘before’ i ‘
    nunchuck.h: 230: error: ‘outbuf’ was Not Declared in this scope
    nunchuck.h: 230: error: ‘readControllerIdent’ was Not Declared in this scope
    nunchuck.h: 232: error: ‘Serial’ was not Declared in this scope
    nunchuck.h: 233: error: ‘i’ was not Declared in this scope
    nunchuck.h: 233: error: expected `) ‘before numeric constant
    nunchuck.h: 235: error: ‘HEX’ was Not Declared in this scope
    nunchuck.h: 241: error: ‘Serial’ was not Declared in this scope
    / Nunchuck.h: At global scope:
    nunchuck.h: 245: error: ‘boolean’ does not name a kind
    / Nunchuck.h: In function ‘void NunC_SendNextByteRequest ()’:
    nunchuck.h: 266: error: ‘byte’ was not Declared in this scope
    nunchuck.h: 266: error: expected `; ‘before’ i ‘
    nunchuck.h: 266: error: ‘i’ was not Declared in this scope
    nunchuck.h: 268: error: ‘Wire’ was not Declared in this scope
    nunchuck.h: 268: error: expected `) ‘before numeric constant
    nunchuck.h: 268: error: expected `) ‘before’, ‘token
    / Nunchuck.h: In function ‘void print ()’:
    nunchuck.h: 277: error: ‘Serial’ was not Declared in this scope
    nunchuck.h: 277: error: ‘NunC_JX’ was Not Declared in this scope
    nunchuck.h: 277: error: ‘DEC’ was not Declared in this scope
    nunchuck.h: 280: error: ‘NunC_JY’ was Not Declared in this scope
    nunchuck.h: 283: error: ‘NunC_AX’ was Not Declared in this scope
    nunchuck.h: 286: error: ‘NunC_AY’ was Not Declared in this scope
    nunchuck.h: 289: error: ‘NunC_AZ’ was Not Declared in this scope
    nunchuck.h: 292: error: ‘NunC_BZ’ was Not Declared in this scope
    nunchuck.h: 295: error: ‘NunC_BC’ was Not Declared in this scope
    nunchuk_h.cpp: In function ‘void loop ()’:
    nunchuk_h: 11: error: ‘NunC_RecieveCommand’ was Not Declared in this scope
    nunchuk_h: 13: error: ‘NunC_print’ was Not Declared in this scope

    I’m sorry for all this ^^

  • August 24, 2013 at 11:53 am#1824EDIT | MOVE | SPLIT | TRASH | SPAM | REPLYOscar
    Keymaster
    (81.108.179.49)Hi Stephanei think i found what the problem is now, we forgot to declare the “Wire” library.

    in your main program you need to replace the “#include “nunchuck.h” with this

    #ifndef NUNCHUCK_H
      #define NUNCHUK_H
      #include <Wire.h>
      #include "nunchuck.h"
    #endif
    

    I have uploaded a test program which i have tested working

5 thoughts on “Robot Forum Archive

  1. Fajar

    Hii Oscar. i see your video in youtube. you can explain how balance mode works in to hexapod?
    what method can i use for my balance hexapod? like you
    iam fajar from indonesian thanks.

    Reply
  2. Gregory Roberts

    I am a 17-year old high school student, developing a hexapod that will be teaching itself to walk. Can you send me your hexapod code, so I can get an idea of how to program the inverse kinematics?

    Reply
  3. XJ

    Hi Oscar, I’m really new to robotics, and I’ve been trying to wrap my head around Inverse Kinematics. I read your post on the basics of IK for 3DOF leg. I’m just trying to get some clarity since I’m really new to all these.

    Re: when you say you are breaking the 3D problem of the leg into two 2D problems, essentially, it’s about the rotation of the hip servo, and then the rotation of the knee and ankle servo, is it not? I’m just focusing on the first problem and trying to figure out where to get all the variables (x, y, and gamma). Would I be correct if I assume that x is the position of the foot while rotating on the z axis (gamma) and y is the distance of the foot from the main body?

    Thank you very much!

    Reply
    1. Oscar Post author

      1. 3D to 2 x 2D, yes you got it.
      2. I am not sure which diagram or equation you are referring to with X, Y and Gamma?

      Reply
  4. mat

    Hi I have a simple question for you I hope you can help me with not half as technical as most…..
    I am wanting to build a rc controller to suit my specific needs rather than buy one that’s not good enough ….. My intentions are to build a controller and connect it to a long range transmitter to achieve long range control as you might do via the trainer port on many controllers.
    So my question are :
    How many channels can I have and are they all for servo type operation ?
    Is what I’m suggesting viable
    What do I need to know regards making the controller compatible to long range transmitters etc
    In an ideal world there would be an of the shelf multi controller plug in board that had x amount of channels and it was simply a case of connecting your own selection of switch’s and sliders etc and of course you can then arrange in space tbose said controls as you wish to suit your own personal set up and requirements ……. Have you any idea how I might achieve something close to this .
    Absolutely any pointers and ideas as to how I can achieve such controller to attach to the long range 433_MHz UHF transmitter is greatly appreciated .

    Many many thanks and keep up the brilliant work .

    Ma

    Reply

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

Are you Robot? *

For prompt technical support, please use our forum IntoFPV.com. I check blog comments weekly.