Skip to content

Commit

Permalink
electrical_protocol: Add simulated test to CMakeLists, remove extrane…
Browse files Browse the repository at this point in the history
…ous log statements, fix endianness of testing payload formats
  • Loading branch information
cbrxyz committed Sep 27, 2024
1 parent 2c5700a commit d6c8361
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions mil_common/drivers/electrical_protocol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ catkin_package()

if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
# add_rostest(test/adder_device_sub9.test)
# add_rostest(test/echo_device_sub9.test)
# add_rostest(test/basic.test)
add_rostest(test/simulated.test)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def adjust_read_rate(self, rate: float) -> None:
"""
self.timer.shutdown()
self.rate = min(rate, 1_000)
rospy.logerr(f"Setting rate to {rate}")
self.timer = rospy.Timer(rospy.Duration(1.0 / rate), self._process_buffer) # type: ignore

def scale_read_rate(self, scale: float) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@


@dataclass
class RequestAddPacket(Packet, class_id=0x37, subclass_id=0x00, payload_format="ff"):
class RequestAddPacket(Packet, class_id=0x37, subclass_id=0x00, payload_format="<ff"):
number_one: float
number_two: float


@dataclass
class RequestSubPacket(Packet, class_id=0x37, subclass_id=0x01, payload_format="ff"):
class RequestSubPacket(Packet, class_id=0x37, subclass_id=0x01, payload_format="<ff"):
start: float
minus: float


@dataclass
class AnswerPacket(Packet, class_id=0x37, subclass_id=0x02, payload_format="f"):
class AnswerPacket(Packet, class_id=0x37, subclass_id=0x02, payload_format="<f"):
result: float


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@


@dataclass
class RequestAddPacket(Packet, class_id=0x37, subclass_id=0x00, payload_format="ff"):
class RequestAddPacket(Packet, class_id=0x37, subclass_id=0x00, payload_format="<ff"):
number_one: float
number_two: float


@dataclass
class RequestSubPacket(Packet, class_id=0x37, subclass_id=0x01, payload_format="ff"):
class RequestSubPacket(Packet, class_id=0x37, subclass_id=0x01, payload_format="<ff"):
start: float
minus: float


@dataclass
class AnswerPacket(Packet, class_id=0x37, subclass_id=0x02, payload_format="f"):
class AnswerPacket(Packet, class_id=0x37, subclass_id=0x02, payload_format="<f"):
result: float


Expand Down

0 comments on commit d6c8361

Please sign in to comment.