Ask Your Question

Turtlebot3 Navigating while continiously acquiring images

asked 2020-06-11 09:04:44 -0600

jimc91 gravatar image

I am looking to begin to carry out some basic experimental work with my robot, Turtlebot3 Waffle-pi.

I am using ROS Kinetic & Ubuntu 16.04 LTS.

I have a raspberry pi camera in operation on the robot.

To date I have the camera functioning and acquiring images, but this is all done manually if that makes sense.

What I am looking to do now is use the map of the space that I built using the LiDAR on the robot, and to create a desired path around the space. As the robot will travel this predetermined path, I would want it to begin to acquire images every 2-3 seconds (this can be finalised later after some trial and error) and then save these images with a time stamp to a desired folder path.

To date, I have worked through ROS beginner tutorials, the Turtlebot3 manual and some other tutorials focused on using the raspberry pi camera (links are at the end of this post).

I have done some searching online for some material and guidance on the steps that I have laid out above but cannot seem to find anything, maybe I am looking in the wrong places....

Would anyone have some links or material that they could provide me with on this to get me started? Maybe I am getting ahead of myself and need to carry out some more basic testing, I am open to all ideas/guidance.

So in summary, I am looking to;

  • Create a map of a space (complete)
  • Choose a predetermined path for the robot to take (not started)
  • Have robot acquire images every set number of seconds, save the image with a time stamp to a desired folder path (not started)
  • Continue this imaging until path is complete (not started)

Any help would be greatly appreciated.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-12 00:28:59 -0600

achille gravatar image

Once you have your map, you have to localize to that map. With your lidar and wheel odometry, you can do that probably similar to how you made your map. The wafflebot instructions are pretty clear. Once you can localize on that map, you can use it to navigate the robot by sending it waypoints. You can use RViz to do so.

If you're looking to have your robot navigate to several waypoints autonomously, you simply have to write a script that publishes the desired waypoints on the map to the navigation goal command topic, typically /move_base.

To save images periodically, you'll have to write a ROS node with a Subscriber as in the tutorials which subscribes to the image topic from the camera. I assume that the Wafflebot already did this, use rostopic list to find the topic with the camera images. The sensor_msgs/Image message comes with a header that contains a timestamp, so your subscriber should then use that to save the image when it comes into the callback. There are many ways to then save that image to file, for example converting and saving with OpenCV. You could set up your subscriber to only save the image when it's older than a few seconds compared to the last saved image. Alternatively you can use a timer and use rospy.wait_for_message (if using Python).

Once you have those separate components working, you can combine them into one node.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-06-11 09:04:44 -0600

Seen: 54 times

Last updated: Jun 12 '20