Ask Your Question
0

pointcloud in ros with eclipse

asked 2013-12-26 01:18:34 -0500

Juni gravatar image

updated 2014-01-28 17:18:54 -0500

ngrennan gravatar image

Hello, I'm ubuntu 12.04 , groovy user.

I'm learning pointcloud in ros and want to use Eclipse(Kepler) for IDE.

When making with catkin, Code is perfect.(didn't show any error)

But Eclipse couldn't index some codes(in pointcloud).

I made package for eclipse by following command.

catkin_make --force-cmake \
  -G"Eclipse CDT4 - Unix Makefiles" \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j4

After doing this, I imported [build] folder in Eclipse.

Many red lines are appeared under code about ros, pcl.

For example, ros::init(argc, argv, "pcl_test_node"), pcl::PointXYZ point ...etc

I solved this problem with following progress.

  1. [Project]-[Properties]-[C/C++ General]-[Preprocessor Include Paths...]-[Providers] then, check [CDT GCC Build Output Parser] and [CDT GCC Built-in Compiler Settings[shared]]
  2. [Project]-[Properties]-[C/C++ Include Paths and Symbols] then, delete include path [/usr/include/eigen3]

  3. rebuild.

Finally, I removed many red lines in codes, but not in some parts of pcl.

In the next code, Eclipse couldn't index two parts.

  1. cloud->points it showed points as '?' and didn't index the members of points. and cloud->points.push_back(...) error message was 'Method 'push_back' could not be resolved'

  2. iterator iter->x = 10.0; -> red line under 'x' appear And error message was 'Field 'x' could not be resolved'

I think there may be other things I didn't realize yet.

I did many things for correcting this problem but I failed.

Any one who had same problem, please help me.

And thank for your reading in advance.

source code is here

#include <ros/ros.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl_ros/point_cloud.h>

int main(int argc, char ** argv){

    ros::init(argc,argv,"pcl_test_node");
    ros::NodeHandle nh;
    ros::NodeHandle p_nh("~");

    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>());

    for(int i=0;i<20;i++){
        cloud->points.push_back(pcl::PointXYZ(i*10.0,2.0,3.0));
    }

    pcl::PointCloud<pcl::PointXYZ>::iterator iter;

    iter = cloud->begin();

    for(;iter != cloud->end(); iter++){
        iter->x = 10.0;
    }

    while(ros::ok());
}
edit retag flag offensive close merge delete

Comments

"and I made package for eclipse": how exactly did you do this? If you used catkin to generate the Eclipse project files, and your pkg depends on the PCL integration pkg, I think catkin should add the PCL include dirs automatically for you.

gvdhoorn gravatar image gvdhoorn  ( 2013-12-27 07:31:28 -0500 )edit

Yes, I did it by catkin. Command is following. catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j4

Juni gravatar image Juni  ( 2013-12-29 20:23:53 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-01-01 23:30:54 -0500

Artem gravatar image

You are doing everything right. Now right click on your project folder, then select Index/Rebuild in the popped-up menu. It will take time to re-index.

edit flag offensive delete link more
0

answered 2016-10-19 06:34:14 -0500

I did what's on the ROS tutorial ( http://wiki.ros.org/IDEs#General ) Eclipse then recognized ROS but not PCL (I've installed PCL 1.8 on Ubuntu 14.04, ROS indogo)

With this tutorial from the ETH eclipse then could recognize PCL code, aka autocompletion https://github.com/ethz-asl/programmi...

I can also build now inside eclipse :)

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

Stats

Asked: 2013-12-26 01:18:34 -0500

Seen: 809 times

Last updated: Oct 19 '16