def test_revolute_ctor():
    q = [4.5, 1.7, 0.5, 2.1, 0.1, 2.1]
    config = Configuration.from_revolute_values(q)
    assert config.types == [Joint.REVOLUTE] * 6

    config = Configuration.from_revolute_values([pi / 2, 0., 0.])
    assert to_degrees(config.values) == [90, 0, 0]
Exemple #2
0
    def revolute_configuration_to_robot_joints(configuration):
        """Convert a :class:`compas_fab.robots.Configuration` to a :class:`compas_rrc.RobotJoints`.

        Parameter
        ---------
        configuration : :class:`Configuration`

        Returns
        -------
        :class:`RobotJoints`
        """  # noqa: E501
        revolute_values_in_degrees = to_degrees(configuration.revolute_values)
        return RobotJoints(*revolute_values_in_degrees)
Exemple #3
0
    def to_compas_rrc(
        self,
    ):  # type: () -> Tuple[Callable, List[Union[Frame, compas_rrc.RobotJoints]]]
        if self.trajectory_type == self.FRAME_TRAJECTORY:
            rrc_trajectory = self._list
            rrc_instruction = compas_rrc.MoveToRobtarget
        if self.trajectory_type == self.JOINT_TRAJECTORY:
            rrc_trajectory = [
                compas_rrc.RobotJoints(*to_degrees(pt.values)) for pt in self.points
            ]
            rrc_instruction = compas_rrc.MoveToJoints

        return rrc_instruction, rrc_trajectory