diff --git a/opentera_webrtc_ros/scripts/labels_manager.py b/opentera_webrtc_ros/scripts/labels_manager.py index 0a0dfcd..88d9442 100755 --- a/opentera_webrtc_ros/scripts/labels_manager.py +++ b/opentera_webrtc_ros/scripts/labels_manager.py @@ -5,8 +5,6 @@ import rospy import json from pathlib import Path -from rospy_message_converter.message_converter import convert_ros_message_to_dictionary as ros2dict -from rospy_message_converter.message_converter import convert_dictionary_to_ros_message as dict2ros from opentera_webrtc_ros_msgs.msg import LabelSimple, LabelSimpleArray, LabelSimpleEdit from opentera_webrtc_ros_msgs.msg import Label, LabelArray, LabelEdit from opentera_webrtc_ros_msgs.msg import Waypoint @@ -26,7 +24,17 @@ class LabelData: yaml_tag = "!label" def __init__(self, label: Label) -> None: - self.data = ros2dict(label) + self.data = {} + self.data["name"] = label.name + self.data["description"] = label.description + self.data["pose"]["pose"]["position"]["x"] = label.pose.pose.position.x + self.data["pose"]["pose"]["position"]["y"] = label.pose.pose.position.y + self.data["pose"]["pose"]["position"]["z"] = label.pose.pose.position.z + self.data["pose"]["pose"]["orientation"]["x"] = label.pose.pose.orientation.x + self.data["pose"]["pose"]["orientation"]["y"] = label.pose.pose.orientation.y + self.data["pose"]["pose"]["orientation"]["z"] = label.pose.pose.orientation.z + self.data["pose"]["pose"]["orientation"]["w"] = label.pose.pose.orientation.w + self.data["pose"]["header"]["frame_id"] = label.pose.header.frame_id @property def label(self) -> Label: