The goals of this lab are

  • introduce image processing with OpenCV
  • get an intuition to the visual servoing problem

Deliverables

  • plot of the “trajectory” of the cube in one of the camera images

Druation

  • 2.5 weeks
Deliverables are due on a print-out and delivered at the beginning of the following class.
Image processing pipeline to find the rectangular outline of a Cubelet

Image processing pipeline to find the rectangular outline of a Cubelet

Instructions:

  • Download baxter_cameras.zip, unzip and play it using rosbag
  • Inspect the data using rostopic and image_view.You should see a video of Baxter approaching a cubelet.
  • Download RosToOpenCVImage.cpp and add it to your catkin workspace (how to create a ROS package). You will need to add “cv_bridge” and “image_transport” to the list of dependencies when using catkin_create_pkg. Also make sure to uncomment/edit the add_executable and target_link_libraries commands. A CMakeLists.txt and package.xml are provided below.
  • Run this program using rosrun
  • Inspect the code and try to understand what the different image processing steps do. Notice that they are all displayed in their own window. (The windows might be overlaid when you start the program.)
  • Output the trajectory that the green cube takes. Hint: take advantage of the fact that the cube is green whereas the hand is black.

CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(opencvtest)
find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  image_transport
  roscpp
  rospy
  std_msgs
)
catkin_package(
)
include_directories(
  ${catkin_INCLUDE_DIRS}
)
add_executable(RosToOpencvImage src/RosToOpencvImage.cpp)
target_link_libraries(RosToOpencvImage ${catkin_LIBRARIES})

package.xml:

<?xml version="1.0"?>
<package>
  <name>opencvtest</name>
  <version>0.0.0</version>
  <description>The opencvtest package</description>
  <maintainer email="ncorrell@todo.todo">ncorrell</maintainer>
  <license>TODO</license>
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>cv_bridge</build_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>image_transport</build_depend>
  <run_depend>cv_bridge</run_depend>
  <run_depend>roscpp</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>std_msgs</run_depend>
  <run_depend>image_transport</run_depend>
  <export>
  </export>
</package>

 

 

Leave a Reply

Set your Twitter account name in your settings to use the TwitterBar Section.