diff --git a/NaviGator/mission_control/navigator_missions/vrx_missions/vrx_wayfinding_2.py b/NaviGator/mission_control/navigator_missions/vrx_missions/vrx_wayfinding_2.py index 60496d0b8..966f38be0 100644 --- a/NaviGator/mission_control/navigator_missions/vrx_missions/vrx_wayfinding_2.py +++ b/NaviGator/mission_control/navigator_missions/vrx_missions/vrx_wayfinding_2.py @@ -5,6 +5,7 @@ from .vrx import Vrx ___author___ = "Alex Perez" +# Optimized by Daniel Parra class VrxWayfinding2(Vrx): @@ -42,12 +43,18 @@ async def run(self, parameters): poses = poses[:start_pose_index] path = path[1:] - # self.send_feedback('Sorted poses' + str(poses)) await self.wait_for_task_such_that(lambda task: task.state in ["running"]) # do movements for index in path: self.send_feedback(f"Going to {poses[index]}") - # Go to goal + P = 0.85 + part_way_point = [x * P for x in poses[index][0][:-1]] + part_way_point.append(poses[index][0][-1]) + self.send_feedback( + f"\nPartway:\n{part_way_point}\nEndPoint:\n{poses[index][0]}", + ) + + await self.send_trajectory_without_path([part_way_point, poses[index][1]]) await self.send_trajectory_without_path(poses[index]) diff --git a/mil_common/drivers/mil_usb_to_can/test/test_packets_sub9.py b/mil_common/drivers/mil_usb_to_can/test/test_packets_sub9.py index 01c1dc47a..c58a8c32c 100755 --- a/mil_common/drivers/mil_usb_to_can/test/test_packets_sub9.py +++ b/mil_common/drivers/mil_usb_to_can/test/test_packets_sub9.py @@ -8,7 +8,7 @@ @dataclass -class TestPacket(Packet, msg_id=0x47, subclass_id=0x44, payload_format="BHf"): +class TestPacket(Packet, msg_id=0x47, subclass_id=0x44, payload_format="?Hd"): example_bool: bool example_int: int example_float: float @@ -23,7 +23,7 @@ def test_simple_packet(self): packet = TestPacket(False, 42, 3.14) self.assertEqual(packet.msg_id, 0x47) self.assertEqual(packet.subclass_id, 0x44) - self.assertEqual(packet.payload_format, "BHf") + self.assertEqual(packet.payload_format, "?Hd") self.assertEqual(packet.example_bool, False) self.assertEqual(packet.example_int, 42) self.assertEqual(packet.example_float, 3.14) @@ -36,6 +36,13 @@ def test_assembled_packet(self): self.assertEqual(assembled[2], packet.msg_id) self.assertEqual(assembled[3], packet.subclass_id) + def test_format(self): + packet = TestPacket(False, 42, 3.14) + self.assertEqual( + TestPacket.from_bytes(TestPacket.__bytes__(packet)), + packet, + ) + def test_comparisons(self): packet = TestPacket(False, 42, 3.14) packet_two = TestPacket(False, 42, 3.14)