ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

David Bravo's profile - activity

2016-04-28 00:00:35 -0500 received badge  Taxonomist
2013-03-10 01:48:20 -0500 received badge  Famous Question (source)
2012-09-30 23:07:31 -0500 received badge  Famous Question (source)
2012-09-27 00:47:01 -0500 received badge  Famous Question (source)
2012-09-27 00:47:01 -0500 received badge  Notable Question (source)
2012-08-29 06:26:45 -0500 received badge  Famous Question (source)
2012-08-27 16:31:36 -0500 received badge  Notable Question (source)
2012-08-24 11:50:22 -0500 received badge  Notable Question (source)
2012-08-22 01:25:34 -0500 commented question no message received in Rviz

Thanks Lorenz! the those lines fixed the Frame[] does not exist errors, but I'm still not getting anything out, now it just shows: Status:Error.

Points Showing [0] points from [0] messages.

Topic No messages received.

2012-08-22 01:23:17 -0500 received badge  Supporter (source)
2012-08-20 12:02:51 -0500 received badge  Popular Question (source)
2012-08-20 06:51:49 -0500 commented question Publishing a pointcloud problem
2012-08-20 06:47:02 -0500 commented question Publishing a pointcloud problem

Thank you Allenh, I wasn't including pcl_ros/point_cloud.h. Now I feel stupid. I'm using ROS Fuerte and the ros-fuerte-perception-pcl-fuerte-unstable package because I need the NARF keypoints. Now the topic is published but I can't see it in RVIZ because I get a "No message received" error.

2012-08-20 06:40:42 -0500 asked a question no message received in Rviz

Hi everyone, I'm using the following code to publish keypoints extracted from a kinect depth image. It compiles and runs without problems and I can select the keypoints topic in Rviz but it gives me the following errors:

Status:Error.

Points Showing [0] points from [0] messages.

Topic No messages received.

Transform For frame[]: Frame[] does not exist.

Am I doing something wrong here? this is the code:

typedef pcl::PointCloud<pcl::PointCloud<int> > PointCloud;
typedef pcl::PointXYZ PointType;

ros::Publisher pub;

pcl::PointCloud<int> keypoint_indices;

pcl::PointCloud<pcl::PointXYZ>::Ptr keypoints_ptr (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>& keypoints = *keypoints_ptr;


float angular_resolution_;
float support_size_ =0.2f;//-0.1f

image_geometry::PinholeCameraModel model_;

void cameraModelCallback(const sensor_msgs::CameraInfoConstPtr &info_msg)
{
    model_.fromCameraInfo(info_msg);
}

void depthimage_cb(const sensor_msgs::ImageConstPtr &depth_msg)
{
    const uint16_t* depthImage = reinterpret_cast<const uint16_t*>(&depth_msg->data[0]);

    pcl::RangeImagePlanar range_image_;
    pcl::RangeImageBorderExtractor range_image_border_extractor_;

    // convert the depth-image to a pcl::rangeImage
    angular_resolution_ = 0.5f(float)(-1);
    /*range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, (depth_msg->width)/2, (depth_msg->height)/2, 600.0, 600.0, angular_resolution_);*/
    range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, model_.cx(), model_.cy(),model_.fx(), model_.fy(), angular_resolution_);

    range_image_.setUnseenToMaxRange();
    pcl::NarfKeypoint keypoint_det;

    // extract the indices of the NARF-Keypoints
    keypoint_det.getParameters ().support_size =  support_size_;
    keypoint_det.setRangeImageBorderExtractor (&range_image_border_extractor_);
    keypoint_det.setRangeImage (&range_image_);
    keypoint_det.compute (keypoint_indices);

    keypoints.points.resize (keypoint_indices.points.size ());
    for (size_t i=0; i<keypoint_indices.points.size (); ++i)
    keypoints.points[i].getVector3fMap () = range_image_.points[keypoint_indices.points[i]].getVector3fMap ();
    pub.publish (keypoints);
} 



int
main (int argc, char** argv)
{
  // Initialize ROS
  ros::init (argc, argv, "keypointsplanar");
  ros::NodeHandle nh1;

  // Create a ROS subscriber for the input point cloud
  ros::Subscriber sub1 = nh1.subscribe ("/camera/depth/image", 1, depthimage_cb);   
  ros::Subscriber sub2 = nh1.subscribe ("/camera/depth/camera_info", 1, cameraModelCallback);   

  // Create a ROS publisher for the output point cloud
  pub = nh1.advertise<pcl::PointCloud<pcl::PointXYZ> > ("keypoints", 1);

  // Spin
  ros::spin ();
}
2012-08-20 06:06:11 -0500 received badge  Popular Question (source)
2012-08-19 16:32:24 -0500 received badge  Notable Question (source)
2012-08-19 06:40:14 -0500 received badge  Popular Question (source)
2012-08-17 05:59:22 -0500 asked a question Publishing a pointcloud problem

Hello, I'm trying to publish a pointcloud that contains the narfkeypoints extracted from a range image with the following code:

#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/CameraInfo.h>

// PCL specific includes
#include <pcl/ros/conversions.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/filters/voxel_grid.h>

#include <pcl/features/narf.h>
#include <pcl/keypoints/narf_keypoint.h>
#include <pcl/range_image/range_image.h>
#include <pcl/features/range_image_border_extractor.h>
#include <pcl/range_image/range_image_planar.h>

typedef pcl::PointCloud<pcl::PointCloud<int> > PointCloud;
typedef pcl::PointXYZ PointType;

ros::Publisher pub;

pcl::PointCloud<int> keypoint_indices;

pcl::PointCloud<pcl::PointXYZ>::Ptr keypoints_ptr (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>& keypoints = *keypoints_ptr;


float angular_resolution_;
float support_size_ =0.2f;//-0.1f

void depthimage_cb(const sensor_msgs::ImageConstPtr &depth_msg)
{
    const uint16_t* depthImage = reinterpret_cast<const uint16_t*>(&depth_msg->data[0]);

    pcl::RangeImagePlanar range_image_;
    pcl::RangeImageBorderExtractor range_image_border_extractor_;

    // convert the depth-image to a pcl::rangeImage
    angular_resolution_ = (float)(-1);
    range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, (depth_msg->width)/2, (depth_msg->height)/2, 600.0, 600.0, angular_resolution_);

    range_image_.setUnseenToMaxRange();
    pcl::NarfKeypoint keypoint_det;

    // extract the indices of the NARF-Keypoints
    keypoint_det.getParameters ().support_size =  support_size_;
    keypoint_det.setRangeImageBorderExtractor (&range_image_border_extractor_);
    keypoint_det.setRangeImage (&range_image_);
    keypoint_det.compute (keypoint_indices);

    keypoints.points.resize (keypoint_indices.points.size ());
    for (size_t i=0; i<keypoint_indices.points.size (); ++i)
    keypoints.points[i].getVector3fMap () = range_image_.points[keypoint_indices.points[i]].getVector3fMap ();
   // pub.publish (keypoints);
} 

int
main (int argc, char** argv)
{
  // Initialize ROS
  ros::init (argc, argv, "keypointsplanar");
  ros::NodeHandle nh1;
  ros::NodeHandle nh2;

  // Create a ROS subscriber for the input point cloud
  ros::Subscriber sub2 = nh1.subscribe ("/camera/depth/image", 1, depthimage_cb);   

  // Create a ROS publisher for the output point cloud
  //pub = nh2.advertise<pcl::PointCloud<pcl::PointXYZ>& keypoints> ("keypoints", 1);

  // Spin
  ros::spin ();
}

If I comment the pub.publish (keypoints); and the pub = nh2.advertise<pcl::pointcloud<pcl::pointxyz>& keypoints> ("keypoints", 1); lines the code compiles with no problems or warnings, however, if I uncomment them I keep getting these errors:

{-------------------------------------------------------------------------------[ rosmake ] [ make ] [ tesis: 11.3 sec ] [ 1 Active 29/30 Complete ] from /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:1: /opt/ros/fuerte/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum<m>::value(const M&) [with M = pcl::PointCloud<pcl::pointxyz>]’: /opt/ros/fuerte/include/ros/message_traits.h:255:104: instantiated from ‘const char* ros::message_traits::md5sum(const M&) [with M = pcl::PointCloud<pcl::pointxyz>]’ /opt/ros/fuerte/include/ros/publisher.h:112:7: instantiated from ‘void ros::Publisher::publish(const M&) const [with M = pcl::PointCloud<pcl::pointxyz>]’ /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:57:27: instantiated from here /opt/ros/fuerte/include/ros/message_traits.h:126:34: error: ‘const class pcl::PointCloud<pcl::pointxyz>’ has no member named ‘__getMD5Sum’ /opt/ros/fuerte/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType<m>::value(const M&) [with M = pcl::PointCloud<pcl::pointxyz>]’: /opt/ros/fuerte/include/ros/message_traits.h:264:106: instantiated from ‘const char* ros::message_traits::datatype(const M&) [with M = pcl::PointCloud<pcl::pointxyz ... (more)

2012-08-15 07:39:24 -0500 received badge  Popular Question (source)
2012-08-07 01:58:07 -0500 asked a question Extracting narf keypoints from kinect depth image problem

Hi, I'm trying get NARF keypoints using depth images from a kinect with the following code but I keep getting the errors at the bottom of the post when I try to compile, the problem seems to occur when I try to publish the keypoints, I just need to publish the keypoints so I can see them in Rviz. Could anyone shed some light onto what I'm doing wrong?

typedef pcl::PointCloud<pcl::pointcloud<int> > PointCloud;

ros::Publisher pub;

pcl::PointCloud<int> keypointsout;

float angular_resolution_; float support_size_ =0.2f;

void depthimage_cb(const sensor_msgs::ImageConstPtr &depth_msg) { const uint16_t* depthImage = reinterpret_cast<const uint16_t*&gt;(&amp;depth_msg-="">data[0]);

pcl::RangeImagePlanar range_image_;
pcl::RangeImageBorderExtractor range_image_border_extractor_;

// convert the depth-image to a pcl::rangeImage
angular_resolution_ = (float)(-1);
range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, (depth_msg->width)/2, (depth_msg->height)/2, 600.0, 600.0, angular_resolution_);

range_image_.setUnseenToMaxRange();
pcl::NarfKeypoint keypoint_det;

keypoint_det.getParameters ().support_size =  support_size_;
keypoint_det.setRangeImageBorderExtractor (&range_image_border_extractor_);
keypoint_det.setRangeImage (&range_image_);

keypoint_det.compute (keypointsout); pub.publish (keypointsout); }

int main (int argc, char** argv) { // Initialize ROS ros::init (argc, argv, "keypointsplanar"); ros::NodeHandle nh2; //pub = nh2.advertise< PointCloud > ("keypointsout", 1);

ros::Subscriber sub2 = nh1.subscribe ("/camera/depth/image", 1, depthimage_cb);

pub = nh2.advertise<pcl::pointcloud<int> keypointsout> ("keypointsout", 1);

// Spin ros::spin (); }

ERRORS:

from /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:1: /opt/ros/fuerte/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum<m>::value(const M&) [with M = pcl::PointCloud<int>]’: /opt/ros/fuerte/include/ros/message_traits.h:255:104: instantiated from ‘const char* ros::message_traits::md5sum(const M&) [with M = pcl::PointCloud<int>]’ /opt/ros/fuerte/include/ros/publisher.h:112:7: instantiated from ‘void ros::Publisher::publish(const M&) const [with M = pcl::PointCloud<int>]’ /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:49:30: instantiated from here /opt/ros/fuerte/include/ros/message_traits.h:126:34: error: ‘const class pcl::PointCloud<int>’ has no member named ‘__getMD5Sum’ /opt/ros/fuerte/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType<m>::value(const M&) [with M = pcl::PointCloud<int>]’: /opt/ros/fuerte/include/ros/message_traits.h:264:106: instantiated from ‘const char* ros::message_traits::datatype(const M&) [with M = pcl::PointCloud<int>]’ /opt/ros/fuerte/include/ros/publisher.h:112:7: instantiated from ‘void ros::Publisher::publish(const M&) const [with M = pcl::PointCloud<int>]’ /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:49:30: instantiated from here /opt/ros/fuerte/include/ros/message_traits.h:143:36: error: ‘const class pcl::PointCloud<int>’ has no member named ‘__getDataType’ In file included from /opt/ros/fuerte/include/ros/publisher.h:34:0, from /opt/ros/fuerte/include/ros/node_handle.h:32, from /opt/ros/fuerte/include/ros/ros.h:45, from /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:1: /opt/ros/fuerte/include/ros/serialization.h: In static member function ‘static uint32_t ros::serialization::Serializer<t>::serializedLength(typename boost::call_traits<t>::param_type) [with T = pcl::PointCloud<int>, uint32_t = unsigned int, typename boost::call_traits<t ... (more)

2012-07-25 07:00:51 -0500 asked a question OpenCV PinholeCameraModel undefined reference

Hi, I'm trying to the the camera model information by using:

void cameraModel_cb(const sensor_msgs::CameraInfoConstPtr &info_msg) { image_geometry::PinholeCameraModel model_; model_.fromCameraInfo(info_msg); fx = model_.fx(); fy = model_.fy(); }

Where info_msg is /camera/depth_registered/camera_info from the openni.launch node. I need the IR camera focal lenght in order to get range images using:

range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, (depth_msg->width)/2, (depth_msg->height)/2, fx, fy, angular_resolution_);

The problem is that I keep getting this error:

CMakeFiles/keypointsplanar.dir/src/keypointsplanar.o: In function cameraModel_cb(boost::shared_ptr<sensor_msgs::CameraInfo_<std::allocator<void> > const> const&)': /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:26: undefined reference toimage_geometry::PinholeCameraModel::PinholeCameraModel()' /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:27: undefined reference to `image_geometry::PinholeCameraModel::fromCameraInfo(boost::shared_ptr<sensor_msgs::camerainfo_<std::allocator<void> > const> const&)' collect2: ld returned 1 exit status

when trying to compile my program. I linked the libraries in the CMakeList file like this:

FIND_PACKAGE( OpenCV REQUIRED ) rosbuild_add_executable (keypointsplanar src/keypointsplanar.cpp) TARGET_LINK_LIBRARIES( keypointsplanar ${OpenCV_LIBRARIES} )

I'd really appreciate some help with this problem, thanks in advance.