Adding an extra link and joint to the Brat template

Hello support,

I’m trying to add a new link to the Brat template. I would like to have three links between the ankle and the body. Eventually I’d like to have 12 servos in total including a rotator and adductor on the body as well (see screenshot ‘Before and After’).

So far I have made some minor changes to the body size and link size, I thought I had figured out the coordinates but my new link does not display correctly (see Scout body with w4 link).

I have added w4 as my new link to the existing joints array:

w4 = w3
nxt = @arm.links.index(link)+1
if nxt < @arm.links.size
w4 = @arm.links[nxt]:w]/3.0 * sf
else
w4 = 2.5 * sf
end
joints.push [x,y,w2,w4]
f = 0.3;

Then I added w4 into the coordinates:

coords = -w2,0],-w3,-len],[w3,-len],[w2,0],-w4,0],[w4,0],[0,-len],-w2*(1+f),f],-w3*(1+f),-len*(1+f)],[w3*(1+f),-len*(1+f)],[w2*(1+f),f],-w4*(1+f),f],[w4*(1+f),f]]

But I’m not sure how to reference those coordinates when it comes to drawing the new link correctly. It looks to me that the joints are defined logically and then drawn using a graphics path which references the coordinates. But I don’t see how the coords 0,1,2,3 reference the -w2,-len or 0 in the coords in the array?

gp = GraphicsPath.new 
gp.addLine coords[0],coords[1]
gp.addLine coords[1],coords[2]
gp.addLine coords[2],coords[3]
gp.closeFigure

I’ve attached the project and the modified code. Any help appreciated, thanks!

Attachments:
Before and After
Scout body with w4 link
Brat_Mech_mod_1.07
New draw arm code.txt (4.02 KB)
Brat_Mech_mod_1.07.fsp (1010 KB)
Scout body with w4 link.PNG

Hi,

Modifying any of the existing robots to add a link will be quite a bit of work (i.e.: non-trivial).

You will need to not only modify the drawing code but also the robot definitions, the inverse kinematics code and the interaction code (see images below).

You should probably follow around the various wireless links (select the link using one left click. then, press TAB to move through the various modules using it) used throughout the app, such as TheRobot, Interaction, etc.

What it comes down too is that you will most likely have to explore/experiment more with this code to help you understand it fully before your modifications have the desired results.

Sincerely,

Hello Sébastien,

Thanks for the advise, yes there are several modules that will need to be modified. Using the TAB key to navigate between the wireless links is a good tip, I did not know that.

I’m configuring the modules one step at a time, and fully anticipate that at a later stage I will need to adjust the code in the other modules.

The module I’m editing at the moment though (Draw Arm - within Front Left Elevation) should reflect the results ok as long as the coordinates are set correctly.

Is there anyone who can advise on the coords?

Kind regards
Nick

I have a SSC-32U interfaced with the Flowbotics studio and just got started with exploring the details of the schematics’ layers. Would adding an extra “appendage” like say a head, tail or gripper to a hexapod or quadruped also require editing the IK and interactions code? I’m assuming the definitions will need to be addressed.

Hey,

Yes, it would. Well, if you want them to move in relationship to the rest of the robot in a specific way, that is. Let’s just say this will not be trivial to do with lots of trial and error.

Sincerely,

Thanks scharette. The function of the extra “appendage” will be controlled independently of the hexapod’s gait. It’ll most likely be controlled by a dedicated set of buttons on a game pad or on the keyboard.

Then you should create a separate IK chain for that appendage.
A probably simple solution would be doubling (and renaming) the existing structures and modify this new copy to work as required for the extra ppendage.