Skip to content

Commit c90c7a3

Browse files
committed
added support for Point datatypes. This enables mouse click
1 parent 759b75f commit c90c7a3

File tree

1 file changed

+9
-1
lines changed
  • formant_ros2_adapter/scripts

1 file changed

+9
-1
lines changed

formant_ros2_adapter/scripts/main.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,15 @@ def handle_formant_teleop_msg(self, msg):
11921192
self.publish_ros2_numeric(publisher, ros2_msg_type, msg_value)
11931193

11941194
elif msg.HasField("point"):
1195-
print("WARNING: Point is not yet supported")
1195+
point = Point(x=msg.point.x, y=msg.point.y, z=msg.point.z)
1196+
if ros2_msg_type == "Point":
1197+
ros2_msg = point
1198+
elif ros2_msg == "PointStamped":
1199+
ros2_msg = PointStamped(point=point)
1200+
else:
1201+
self._logger.warn("Unsupported Point Type: %s" % ros2_msg_type)
1202+
publisher.publish(ros2_msg)
1203+
11961204
elif msg.HasField("pose"):
11971205
print("WARNING: Pose is not yet supported")
11981206
elif msg.HasField("pose_with_covariance"):

0 commit comments

Comments
 (0)