def test_to_data(): config = Configuration.from_prismatic_and_revolute_values( [8.312], [1.5, 0., 0., 0., 1., 0.8]) # joint_types=[Joint.PRISMATIC, Joint.REVOLUTE])) data = config.to_data() assert data['joint_values'] == [8.312, 1.5, 0., 0., 0., 1., 0.8] assert data['joint_types'] == [Joint.PRISMATIC] + [Joint.REVOLUTE] * 6
def config_from_vrep(list_of_floats, scale): # COMPAS FAB uses radians and meters, just like V-REP, # so in general, scale should always be 1 radians = list_of_floats[3:] prismatic_values = map(lambda v: v * scale, list_of_floats[0:3]) return Configuration.from_prismatic_and_revolute_values(prismatic_values, radians)
def test_prismatic_revolute_ctor(): config = Configuration.from_prismatic_and_revolute_values( [8.312], [1.5, 0., 0., 0., 1., 0.8]) assert config.joint_values == [8.312, 1.5, 0., 0., 0., 1., 0.8] assert config.joint_types == [Joint.PRISMATIC] + [Joint.REVOLUTE] * 6