Skip to content

Commit 8e864d7

Browse files
working parameterisation of toe/foot ratio with lua
1 parent e64e199 commit 8e864d7

File tree

1 file changed

+25
-16
lines changed
  • bitbots_wolfgang/wolfgang_webots_sim/protos/robots/Wolfgang

1 file changed

+25
-16
lines changed

bitbots_wolfgang/wolfgang_webots_sim/protos/robots/Wolfgang/Wolfgang.proto

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ PROTO Wolfgang [
107107
recognitionColors [
108108
0.2 0.2 0.2
109109
]
110+
%{
111+
TOE_FRACTION = 0.3
112+
FOOT_LENGTH = 0.18
113+
FOOT_MASS = 0.26824
114+
TOE_LENGTH = FOOT_LENGTH * TOE_FRACTION
115+
REAR_FOOT_LENGTH = FOOT_LENGTH * (1-TOE_FRACTION)
116+
}%
110117
%{
111118
if fields.name.value ~= '' then
112119
local color = "none"
@@ -1941,7 +1948,7 @@ PROTO Wolfgang [
19411948
}
19421949
# right sole visual
19431950
Transform {
1944-
translation 0.0145000 0.05500 -0.034
1951+
translation 0.0145000 %{=-0.005 + 0.5*REAR_FOOT_LENGTH}% -0.034
19451952
rotation -0.000000 -0.000000 -1.000000 1.570800
19461953
children [
19471954
Shape{
@@ -1951,7 +1958,7 @@ PROTO Wolfgang [
19511958
}
19521959
}
19531960
geometry Box {
1954-
size 0.12000 0.106000 0.0100
1961+
size %{=REAR_FOOT_LENGTH}% 0.106000 0.0100
19551962
}
19561963
}
19571964
]
@@ -2133,16 +2140,18 @@ PROTO Wolfgang [
21332140
# right toe joint
21342141
DEF FlexiJointL HingeJoint {
21352142
jointParameters HingeJointParameters {
2136-
anchor 0.0 0.115 -0.034
2143+
anchor 0.0 %{=-0.005 + REAR_FOOT_LENGTH}% -0.034
21372144
axis 1 0 0
21382145
springConstant IS toe-spring-constant
21392146
minStop 0
21402147
maxStop 0.5
21412148
}
21422149
# right toe visual, collision & physics
2150+
# endPoint is relative to foot base
21432151
endPoint DEF l_flexi Solid {
2144-
translation 0.0145 0.145 -0.034
2152+
translation 0.0145 %{=-0.005 + REAR_FOOT_LENGTH + 0.5*TOE_LENGTH}% -0.034 # y = forward
21452153
rotation 0.0 0.0 -1.0 1.5708
2154+
# for children x = forward
21462155
children [
21472156
Shape {
21482157
appearance Appearance {
@@ -2151,12 +2160,12 @@ PROTO Wolfgang [
21512160
}
21522161
}
21532162
geometry Box {
2154-
size 0.06 0.106 0.01
2163+
size %{=TOE_LENGTH}% 0.106 0.01
21552164
}
21562165
}
21572166
]
21582167
boundingObject Box {
2159-
size 0.06 0.106 0.01
2168+
size %{=TOE_LENGTH}% 0.106 0.01
21602169
}
21612170
physics Physics {
21622171
density -1
@@ -2171,11 +2180,11 @@ PROTO Wolfgang [
21712180
boundingObject Group {
21722181
children [
21732182
Transform {
2174-
translation 0.0145000 0.08500 -0.034
2183+
translation 0.0145000 %{=-0.005 + REAR_FOOT_LENGTH/2}% -0.034
21752184
rotation -0.000000 -0.000000 -1.000000 1.570800
21762185
children [
21772186
Box {
2178-
size 0.18000 0.106000 0.0100
2187+
size %{=REAR_FOOT_LENGTH}% 0.106000 0.0100
21792188
}
21802189
]
21812190
}
@@ -3351,7 +3360,7 @@ PROTO Wolfgang [
33513360
}
33523361
# left foot sole visual
33533362
Transform {
3354-
translation -0.0145000 0.05500 -0.034
3363+
translation -0.0145000 %{=-0.005 + 0.5*REAR_FOOT_LENGTH}% -0.034
33553364
rotation 0.000000 0.000000 -1.000000 1.570800
33563365
children [
33573366
Shape{
@@ -3361,7 +3370,7 @@ PROTO Wolfgang [
33613370
}
33623371
}
33633372
geometry Box {
3364-
size 0.12000 0.106000 0.0100
3373+
size %{=REAR_FOOT_LENGTH}% 0.106000 0.0100
33653374
}
33663375
}
33673376
]
@@ -3559,15 +3568,15 @@ PROTO Wolfgang [
35593568
# left toe joint
35603569
DEF FlexiJointL HingeJoint {
35613570
jointParameters HingeJointParameters {
3562-
anchor 0.0 0.115 -0.034
3571+
anchor 0.0 %{=-0.005 + REAR_FOOT_LENGTH}% -0.034
35633572
axis 1 0 0
35643573
springConstant IS toe-spring-constant
35653574
minStop 0
35663575
maxStop 0.5
35673576
}
35683577
# left toe visual, collision & physics
35693578
endPoint DEF l_flexi Solid {
3570-
translation -0.0145 0.145 -0.034
3579+
translation -0.0145 %{=-0.005 + REAR_FOOT_LENGTH + 0.5*TOE_LENGTH}% -0.034 # y = forward
35713580
rotation 0.0 0.0 -1.0 1.5708
35723581
children [
35733582
Shape {
@@ -3577,12 +3586,12 @@ PROTO Wolfgang [
35773586
}
35783587
}
35793588
geometry Box {
3580-
size 0.06 0.106 0.01
3589+
size %{=TOE_LENGTH}% 0.106 0.01
35813590
}
35823591
}
35833592
]
35843593
boundingObject Box {
3585-
size 0.06 0.106 0.01
3594+
size %{=TOE_LENGTH}% 0.106 0.01
35863595
}
35873596
physics Physics {
35883597
density -1
@@ -3597,11 +3606,11 @@ PROTO Wolfgang [
35973606
boundingObject Group {
35983607
children [
35993608
Transform {
3600-
translation -0.0145000 0.05500 -0.034
3609+
translation -0.0145000 %{=-0.005 + REAR_FOOT_LENGTH/2}% -0.034
36013610
rotation 0.000000 0.000000 -1.000000 1.570800
36023611
children [
36033612
Box {
3604-
size 0.12000 0.106000 0.0100
3613+
size %{=REAR_FOOT_LENGTH}% 0.106000 0.0100
36053614
}
36063615
]
36073616
}

0 commit comments

Comments
 (0)