Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Add asymmetric parameter #3

Closed
patrickpoirier51 opened this issue Apr 13, 2017 · 8 comments
Closed

Add asymmetric parameter #3

patrickpoirier51 opened this issue Apr 13, 2017 · 8 comments

Comments

@patrickpoirier51
Copy link

First of all a big thanks to @mithi for this great code
I do have a different type of hexapod and the servo configuration makes the left and right side asymmetric, so +10 deg on left side makes -10 deg on right side. Not being a programmer I would kindly request that you consider implementing this new parameter (symetry class ?) so we can expand to a larger hexapod compatibility.

Here is a picture of the ''monster'':
img_0997

@mithi
Copy link
Owner

mithi commented Apr 13, 2017

@patrickpoirier51 Awesome stuff! Alright sure! I'll make a symmetry parameter,
can I see it move ?? IE can I see a video? :) :)

@mithi
Copy link
Owner

mithi commented Apr 13, 2017

@patrickpoirier51
Can you explain to me in more detail which parts are moving the wrong way?

for example:
for each leg, there's the hip, knee, and angle.
the hip makes it go side ways, while the knee and angle go up and down.
So +10 on the left three legs move -10 on the right three legs? Which joint is it? How does it make it move wrongly? Up vs Down or Left vs Right? Thanks!

@patrickpoirier51
Copy link
Author

patrickpoirier51 commented Apr 13, 2017

@mithi
Hello Mithi, I will certainly upload a video once it will get its symetry :-)
The more I think about it , it seem more logical to get an additional rotation value (example: 1 for cw and -1 for ccw) to the joint_key convention:
key : (channel, minimum_pulse_length, maximum_pulse_length, rotation)

joint_properties = {
'LFH': (0, 248, 398,1), 'LFK': (1, 188, 476,-1), 'LFA': (2, 131, 600,-1), ....

Below are my notes about rotation for my actual robot.
So for a 45 deg command (calibrate.py) we have:
Left Ankle -45 , Left Knee 45 , Left Hip 45 == Right Hip -45 , Right Knee -45 , Right Ankle 45

image

@mithi
Copy link
Owner

mithi commented Apr 13, 2017

@patrickpoirier51
Alright, thanks for the added information!
The image was really helpful, I'm just finishing something else right now, but I'll get back to you within the week once I've finished your requested changes! Thanks!

@patrickpoirier51
Copy link
Author

patrickpoirier51 commented Apr 15, 2017

@mithi

Hello, I added the direction parameter and it work fine :-)

joint_properties = {

    'LFH': (0, 330, 480, -1), 'LFK': (1, 200, 515, -1), 'LFA': (2, 130, 610, 1),
    'RFH': (3, 380, 530, 1), 'RFK': (4, 300, 615, 1), 'RFA': (5, 130, 610, -1),
    'LMH': (6, 320, 470, -1), 'LMK': (7, 251, 531, -1), 'LMA': (8, 130, 610, 1),
    'RMH': (9, 380, 530, 1), 'RMK': (10, 290, 605, 1), 'RMA': (11, 150, 630, -1),
    'LBH': (12, 350, 500, -1), 'LBK': (13, 200, 515, -1), 'LBA': (14, 180, 660, 1),
    'RBH': (15, 350, 500, 1), 'RBK': (16, 300, 615, 1), 'RBA': (17, 130, 610, -1),
    'N': (18, 150, 650, 1)
class Joint:
    self.channel, self.min_pulse, self.max_pulse, self.direction = joint_properties[jkey]
def pose:
    pulse = remap((angle * self.direction), (-self.max, self.max), (self.min_pulse, self.max_pulse))

@mithi
Copy link
Owner

mithi commented Apr 15, 2017

@patrickpoirier51 awesome! maybe you can submit a pull request, and also looking forward to seeing the video!!!

@mithi
Copy link
Owner

mithi commented May 29, 2017

Hi @patrickpoirier51 I've updated the README, let me know if you find it helpful, thanks!
https://github.com/mithi/hexy/blob/master/README.md

@patrickpoirier51
Copy link
Author

Great , Thanks :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants