Skip to content

Bug in Armature actuator #529

@skadge

Description

@skadge

Using this armature, MORSE crashes with the following error:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/morse/blender/calling.py", line 54, in sensor_action
    component_action(contr)
  File "/usr/lib/python3/dist-packages/morse/blender/calling.py", line 50, in component_action
    cmpt_object.action()
  File "/usr/lib/python3/dist-packages/morse/core/sensor.py", line 76, in action
    self.default_action()
  File "/usr/lib/python3/dist-packages/morse/sensors/armature_pose.py", line 162, in default_action
    joints = self.get_state()
  File "/usr/lib/python3/dist-packages/morse/sensors/armature_pose.py", line 117, in get_state
    joints[channel.name] = self.get_joint(channel.name)
  File "/usr/lib/python3/dist-packages/morse/sensors/armature_pose.py", line 135, in get_joint
    return self._armature_actuator._get_joint_value(joint) # reuse helper functions from armature actuator
  File "/usr/lib/python3/dist-packages/morse/actuators/armature.py", line 226, in _get_joint_value
    axis_index = next(i for i, j in enumerate(self.find_dof(channel)) if j)
StopIteration

Builder script for the robot:

from morse.builder import *

class Pantilt(GroundRobot):
    """
    A template robot model for PanTilt, with a motion controller and a pose sensor.
    """
    def __init__(self, name = None, debug = True):

        # PanTilt.blend is located in the data/robots directory
        Robot.__init__(self, 'pantilt/robots/pantilt.blend', name)
        self.properties(classpath = "pantilt.robots.PanTilt.Pantilt")

        ###################################
        # Actuators
        ###################################


        self.armature = Armature(armature_name = "Armature")
        self.armature.create_ik_targets(["CameraBone"])
        self.arm_pose = ArmaturePose()
        self.armature.append(self.arm_pose)
        self.append(self.armature)

Removing the fixed last bone in the armature fixes the issue.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions