@@ -137,7 +137,6 @@ def get_blender_model_dictionary(self):
137
137
if joint .mimic is not None :
138
138
for k , v in joint .mimic .to_yaml ().items ():
139
139
model ["joints" ][joint .name ]["mimic_" + k ] = v
140
- # [TODO pre_v2.0.0] dynamics, etc.
141
140
model ["links" ][joint .child ]["pose" ] = {'translation' : joint .origin .xyz ,
142
141
'rotation_euler' : joint .origin .rpy ,
143
142
}
@@ -2190,7 +2189,6 @@ def attach(self, other, joint, do_not_rename=False, name_prefix="", name_suffix=
2190
2189
raise Exception ("Provide valid joint type." )
2191
2190
2192
2191
# Check for naming and rename if necessary
2193
- # [TODO pre_v2.0.0] attach the rest
2194
2192
plink = set ([str (link ) for link in self .links ])
2195
2193
pjoints = set ([str (j ) for j in self .joints ])
2196
2194
pcollisions = set ([str (c ) for c in self .get_all_collisions ()])
@@ -2233,7 +2231,7 @@ def attach(self, other, joint, do_not_rename=False, name_prefix="", name_suffix=
2233
2231
2234
2232
if pjoints & cjoints :
2235
2233
if not do_not_rename :
2236
- log .warning (f"Joint names are duplicates a _2 will be appended! { pjoints & cjoints } " )
2234
+ log .warning (f"Joint names are duplicates a { name_suffix } will be appended! { pjoints & cjoints } " )
2237
2235
renamed_entities .update (other .rename (targettype = "joint" , target = list (pjoints & cjoints ), prefix = name_prefix , suffix = name_suffix ))
2238
2236
if joint .name in list (pjoints & cjoints ):
2239
2237
joint .name = joint .name + "_2"
@@ -2242,15 +2240,15 @@ def attach(self, other, joint, do_not_rename=False, name_prefix="", name_suffix=
2242
2240
2243
2241
if pcollisions & ccollisions :
2244
2242
if not do_not_rename :
2245
- log .warning (f"Collision names are duplicates a _2 will be appended! { pcollisions & ccollisions } " )
2243
+ log .warning (f"Collision names are duplicates a { name_suffix } will be appended! { pcollisions & ccollisions } " )
2246
2244
renamed_entities .update (
2247
2245
other .rename (targettype = "collision" , target = list (pcollisions & ccollisions ), prefix = name_prefix , suffix = name_suffix ))
2248
2246
else :
2249
2247
raise NameError ("There are duplicates in collision names" , repr (pcollisions & ccollisions ))
2250
2248
2251
2249
if pvisuals & cvisuals :
2252
2250
if not do_not_rename :
2253
- log .warning (f"Visual names are duplicates a _2 will be appended! { pvisuals & cvisuals } " )
2251
+ log .warning (f"Visual names are duplicates a { name_suffix } will be appended! { pvisuals & cvisuals } " )
2254
2252
renamed_entities .update (
2255
2253
other .rename (targettype = "visual" , target = list (pvisuals & cvisuals ), prefix = name_prefix , suffix = name_suffix ))
2256
2254
else :
@@ -2261,7 +2259,7 @@ def attach(self, other, joint, do_not_rename=False, name_prefix="", name_suffix=
2261
2259
cmaterials .remove (mat_name )
2262
2260
if pmaterials & cmaterials :
2263
2261
if not do_not_rename :
2264
- log .warning (f"Material names are duplicates a _2 will be appended! { pmaterials & cmaterials } " )
2262
+ log .warning (f"Material names are duplicates a { name_suffix } will be appended! { pmaterials & cmaterials } " )
2265
2263
renamed_entities .update (
2266
2264
other .rename (targettype = "material" , target = list (pmaterials & cmaterials ), prefix = name_prefix , suffix = name_suffix ))
2267
2265
else :
@@ -2275,47 +2273,47 @@ def attach(self, other, joint, do_not_rename=False, name_prefix="", name_suffix=
2275
2273
conflicting_sensors .remove (sname )
2276
2274
if conflicting_sensors :
2277
2275
if not do_not_rename :
2278
- log .warning (f"Sensor names are duplicates a _2 will be appended! { conflicting_sensors } " )
2276
+ log .warning (f"Sensor names are duplicates a { name_suffix } will be appended! { conflicting_sensors } " )
2279
2277
renamed_entities .update (
2280
2278
other .rename (targettype = "sensor" , target = list (conflicting_sensors ), prefix = name_prefix , suffix = name_suffix ))
2281
2279
else :
2282
2280
raise NameError ("There are duplicates in sensor names" , repr (conflicting_sensors ))
2283
2281
2284
2282
if ptransmissions & ctransmissions :
2285
2283
if not do_not_rename :
2286
- log .warning (f"Transmission names are duplicates a _2 will be appended! { ptransmissions & ctransmissions } " )
2284
+ log .warning (f"Transmission names are duplicates a { name_suffix } will be appended! { ptransmissions & ctransmissions } " )
2287
2285
renamed_entities .update (
2288
2286
other .rename (targettype = "transmission" , target = list (ptransmissions & ctransmissions ), prefix = name_prefix , suffix = name_suffix ))
2289
2287
else :
2290
2288
raise NameError ("There are duplicates in transmission names" , repr (ptransmissions & ctransmissions ))
2291
2289
2292
2290
if pmotors & cmotors :
2293
2291
if not do_not_rename :
2294
- log .warning (f"Motor names are duplicates a _2 will be appended! { pmotors & cmotors } " )
2292
+ log .warning (f"Motor names are duplicates a { name_suffix } will be appended! { pmotors & cmotors } " )
2295
2293
renamed_entities .update (
2296
2294
other .rename (targettype = "motor" , target = list (pmotors & cmotors ), prefix = name_prefix , suffix = name_suffix ))
2297
2295
else :
2298
2296
raise NameError ("There are duplicates in motor names" , repr (pmotors & cmotors ))
2299
2297
2300
2298
if pexoskeletons & cexoskeletons :
2301
2299
if not do_not_rename :
2302
- log .warning (f"Exoskeleton names are duplicates a _2 will be appended! { pexoskeletons & cexoskeletons } " )
2300
+ log .warning (f"Exoskeleton names are duplicates a { name_suffix } will be appended! { pexoskeletons & cexoskeletons } " )
2303
2301
renamed_entities .update (
2304
2302
other .rename (targettype = "exoskeleton" , target = list (pexoskeletons & cexoskeletons ), prefix = name_prefix , suffix = name_suffix ))
2305
2303
else :
2306
2304
raise NameError ("There are duplicates in exoskeleton names" , repr (pexoskeletons & cexoskeletons ))
2307
2305
2308
2306
if psubmechanisms & csubmechanisms :
2309
2307
if not do_not_rename :
2310
- log .warning (f"Submechanism names are duplicates a _2 will be appended! { psubmechanisms & csubmechanisms } " )
2308
+ log .warning (f"Submechanism names are duplicates a { name_suffix } will be appended! { psubmechanisms & csubmechanisms } " )
2311
2309
renamed_entities .update (
2312
2310
other .rename (targettype = "submechanism" , target = list (psubmechanisms & csubmechanisms ), prefix = name_prefix , suffix = name_suffix ))
2313
2311
else :
2314
2312
raise NameError ("There are duplicates in submechanism names" , repr (psubmechanisms & csubmechanisms ))
2315
2313
2316
2314
if pinterfaces & cinterfaces :
2317
2315
if not do_not_rename :
2318
- log .warning (f"Interface names are duplicates a _2 will be appended! { pinterfaces & cinterfaces } " )
2316
+ log .warning (f"Interface names are duplicates a { name_suffix } will be appended! { pinterfaces & cinterfaces } " )
2319
2317
renamed_entities .update (
2320
2318
other .rename (targettype = "interface" , target = list (pinterfaces & cinterfaces ), prefix = name_prefix , suffix = name_suffix ))
2321
2319
else :
@@ -2357,14 +2355,6 @@ def attach(self, other, joint, do_not_rename=False, name_prefix="", name_suffix=
2357
2355
assert len (self .joints ) == len (self .get_joints_ordered_df ()), f"{ sorted ([str (x ) for x in self .joints ])} \n { sorted ([str (x ) for x in self .get_joints_ordered_df ()])} "
2358
2356
assert self .get_root ()
2359
2357
2360
- # this will be done by fill_submechanisms we are delaying this to the export to give the user the opportunity to define something thereselves
2361
- # # Add the connection joint to the submechanism tree
2362
- # self.submechanisms += [Submechanism(self, name=joint.name, type="serial", contextual_name="ConnectionJoint",
2363
- # jointnames_independent=[] if joint.type == "fixed" else [joint.name],
2364
- # jointnames_spanningtree=[] if joint.type == "fixed" else [joint.name],
2365
- # jointnames_active=[] if joint.type == "fixed" else [joint.name],
2366
- # jointnames=[joint.name])]
2367
-
2368
2358
self .relink_entities ()
2369
2359
return renamed_entities
2370
2360
0 commit comments