morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
356 stars 155 forks source link

2 Segway RMP400 can not be added in the same scene #421

Closed severin-lemaignan closed 11 years ago

severin-lemaignan commented 11 years ago

The second robot does not work, because of Blender renaming the wheel, which in turn prevent correct parenting.

Unit-test two_segways (631385dd7b9549c) exhibits the bug.

Spotted by Caleb Voss.

severin-lemaignan commented 11 years ago

Workaround suggested by Caleb:

In the builder script:

for r in [robot1, robot2]:
    # Get wheel objects just like it's done in the MORSE source code
    wheels = [child.name for child in r._bpy_object.children if "wheel" in child.name.lower()]
    wheels.sort()
    # Tell the robot what their names are, since a naming collision has caused one set to be renamed
    r.properties(WheelFLName = wheels[0], WheelFRName = wheels[1],
        WheelRLName = wheels[2], WheelRRName = wheels[3])
    r.unparent_wheels()