diff --git a/launch/driver.launch b/launch/driver.launch index 8f16486..8a2ae75 100644 --- a/launch/driver.launch +++ b/launch/driver.launch @@ -8,7 +8,7 @@ ["/vector/joint_states"] - + @@ -53,4 +53,4 @@ - \ No newline at end of file + diff --git a/nodes/vector_node.py b/nodes/vector_node.py index 832285c..a9a2821 100755 --- a/nodes/vector_node.py +++ b/nodes/vector_node.py @@ -25,11 +25,14 @@ else: async_robot = anki_vector.AsyncRobot() - async_robot.camera.init_camera_feed() + # async_robot.camera.init_camera_feed() # connect to Vector async_robot.connect() + # Camera feed? + async_robot.camera.init_camera_feed() + # start all using shared AsyncRobot object Vector(async_robot) Animation(async_robot) @@ -45,4 +48,4 @@ tf_thread = threading.Thread(target=JointStatesPublisher, args=(async_robot,)) tf_thread.start() - rospy.spin() \ No newline at end of file + rospy.spin() diff --git a/src/vector_ros_driver/camera.py b/src/vector_ros_driver/camera.py index 9f457e0..06d8a21 100755 --- a/src/vector_ros_driver/camera.py +++ b/src/vector_ros_driver/camera.py @@ -5,6 +5,8 @@ import cv_bridge import numpy +import cv2 + from sensor_msgs.msg import Image class Camera(object): @@ -19,7 +21,9 @@ def publish_camera_feed(self): bridge = cv_bridge.CvBridge() while not rospy.is_shutdown(): - image = bridge.cv2_to_imgmsg(numpy.asarray(self.async_robot.camera.latest_image), encoding="rgb8") # convert PIL.Image to ROS Image + raw_image = numpy.asarray(self.async_robot.camera.latest_image.raw_image) + # image = bridge.cv2_to_imgmsg(numpy.asarray(self.async_robot.camera.latest_image), encoding="rgb8") # convert PIL.Image to ROS Image + image = bridge.cv2_to_imgmsg(raw_image, encoding="rgb8") # convert PIL.Image to ROS Image image.header.stamp = rospy.Time.now() image.header.frame_id = self.image_frame_id self.image_publisher.publish(image) diff --git a/src/vector_ros_driver/vector.py b/src/vector_ros_driver/vector.py index d39d673..352ca6f 100755 --- a/src/vector_ros_driver/vector.py +++ b/src/vector_ros_driver/vector.py @@ -34,7 +34,7 @@ def battery_state_service_cb(self, request): return response def say_text_cb(self, request): - self.robot.say_text(request.text) + self.robot.behavior.say_text(request.text) return SayTextResponse()