Exemplo n.º 1
0
def mock_frame():
    rbm.register_frame("world")

    def _mock_frame(
        t=None,
        r=None,
        ts=None,
        name="mock",
        parent="world",
        inverse=False,
        discrete=False,
    ):
        """"""
        if t is None and r is None:
            t = (0.0, 0.0, 0.0)
            r = (1.0, 0.0, 0.0, 0.0)

        return rbm.ReferenceFrame(name, parent, t, r, ts, inverse, discrete)

    yield _mock_frame

    rbm.clear_registry()
Exemplo n.º 2
0
    def test_constructor(
        self,
        ReferenceFrameTransformBroadcaster,
        register_rf_tree,
        head_rf_tree,
    ):
        """"""
        # moving frame
        broadcaster = ReferenceFrameTransformBroadcaster(
            "head", publish_pose=True, publish_twist=True
        )
        assert broadcaster.frame.name == "head"
        assert broadcaster.base.name == "world"
        assert broadcaster.pose_publisher is not None
        assert broadcaster.twist_publisher is not None

        # static frame
        rbm.clear_registry()
        register_rf_tree()
        broadcaster = ReferenceFrameTransformBroadcaster("child1")
        assert broadcaster.frame.name == "child1"
        assert broadcaster.base.name == "world"
Exemplo n.º 3
0
def clear_registry():
    """"""
    rbm.clear_registry()
    yield
Exemplo n.º 4
0
 def test_clear_registry(self):
     """"""
     rbm.register_frame("world")
     rbm.clear_registry()
     assert len(rbm.registry) == 0