1234567891011121314 |
- # 导入所需的消息类型
- from geometry_msgs.msg import Point
- # 创建一个 Point 对象,并设置其 x、y、z 坐标值
- point = Point()
- point.x = 1.0
- point.y = 2.0
- point.z = 3.0
- # 打印 Point 对象的内容
- print("Point: ", point)
- print("X coordinate: ", point.x)
- print("Y coordinate: ", point.y)
- print("Z coordinate: ", point.z)
|