Skip to content

Commit

Permalink
Migrate new conversion calls
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
mhidalgo-bdai committed Feb 20, 2024
1 parent 5db297b commit 1e5a734
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spot_driver/spot_driver/spot_ros2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ def handle_list_ptz(self, request: ListPtz.Request, response: ListPtz.Response)
descriptions = []
for proto_description in proto_descriptions:
ros_msg = PtzDescription()
conv.convert_proto_to_bosdyn_msgs_ptz_description(proto_description, ros_msg)
convert(proto_description, ros_msg)
descriptions.append(ros_msg)
response.success = True
response.message = "Success"
Expand All @@ -1623,7 +1623,7 @@ def handle_get_ptz_position(
raise Exception("Spot CAM has not been initialized")

proto_position = self.spot_cam_wrapper.ptz.get_ptz_position(request.name)
conv.convert_proto_to_bosdyn_msgs_ptz_position(proto_position, response.position)
convert(proto_position, response.position)
response.success = True
response.message = "Success"
return response
Expand Down Expand Up @@ -1676,7 +1676,7 @@ def handle_list_cameras(self, request: ListCameras.Request, response: ListCamera
cameras = []
for proto_camera in proto_cameras:
ros_msg = Camera()
conv.convert_proto_to_bosdyn_msgs_camera(proto_camera, ros_msg)
convert(proto_camera, ros_msg)
cameras.append(ros_msg)
response.success = True
response.message = "Success"
Expand All @@ -1699,7 +1699,7 @@ def handle_list_logpoints(
logpoints = []
for proto_logpoint in proto_logpoints:
ros_msg = Logpoint()
conv.convert_proto_to_bosdyn_msgs_logpoint(proto_logpoint, ros_msg)
convert(proto_logpoint, ros_msg)
logpoints.append(ros_msg)
response.success = True
response.message = "Success"
Expand All @@ -1721,7 +1721,7 @@ def handle_retrieve_logpoint(
proto_logpoint, proto_data_chunk = self.spot_cam_wrapper.media_log.retrieve_logpoint(
request.name, request.raw
)
conv.convert_proto_to_bosdyn_msgs_logpoint(proto_logpoint, response.logpoint)
convert(proto_logpoint, response.logpoint)
# Data is actually a bytes object, not DataChunk as the SpotCAM wrapper states...
# Therefore, we use a uint8[] buffer in srv message and directly set that
# to the bytes object.
Expand Down Expand Up @@ -1780,7 +1780,7 @@ def handle_store_logpoint(
tag = None if request.tag == "" else request.tag
camera_name = SpotCamCamera(request.name) # Silly but don't want to modify cam wrapper.
proto_logpoint = self.spot_cam_wrapper.media_log.store(camera_name, tag)
conv.convert_proto_to_bosdyn_msgs_logpoint(proto_logpoint, response.logpoint)
convert(proto_logpoint, response.logpoint)
response.success = True
response.message = "Success"
return response
Expand Down

0 comments on commit 1e5a734

Please sign in to comment.