Ask Your Question

karl's profile - activity

2020-11-26 11:15:11 -0600 received badge  Famous Question (source)
2020-04-28 07:39:32 -0600 received badge  Famous Question (source)
2020-04-13 05:46:41 -0600 commented question How to get correct depth value using kinect? I get all 0

Did you solve the issue ?

2019-12-09 02:33:11 -0600 received badge  Notable Question (source)
2019-12-09 02:33:11 -0600 received badge  Popular Question (source)
2019-06-04 04:01:24 -0600 received badge  Famous Question (source)
2019-03-13 05:31:00 -0600 received badge  Notable Question (source)
2019-02-13 01:53:03 -0600 received badge  Popular Question (source)
2019-02-12 10:09:31 -0600 received badge  Notable Question (source)
2019-02-12 10:01:41 -0600 asked a question Display PointCloud Rviz

Display PointCloud Rviz Following the Laser Scanner Data tutorial I have managed to run the scan to point cloud convert

2019-02-12 09:43:41 -0600 marked best answer Convert Scan to PointCloud, use .h files, undefined reference

I follow the Laser Scanner data tutorial. I want to convert my Scan to a Point Cloud. Here are my files :

CmakeLists.txt :

cmake_minimum_required(VERSION 2.8.3)
project(laserprojection)
find_package(catkin REQUIRED COMPONENTS 
  roscpp
  rospy
  std_msgs
  laser_geometry
    geometry_msgs
  message_generation
    tf
)
find_package(Boost REQUIRED COMPONENTS system)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
add_executable(main test.cpp)
target_link_libraries(main ${Boost_SYSTEM_LIBRARY} ${catkin_LIBRARIES})

Test.cpp :

#include <stdio.h>
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <laser_geometry/laser_geometry.h>

#include "LaserScanToPointCloud.h"

int main(int argc, char** argv)
{
  ros::init(argc, argv, "Mapping1");
    ros::NodeHandle n;
  LaserScanToPointCloud lstopc(n);
  ros::spin();
  return 0;
}

My class.cpp :

#include "LaserScanToPointCloud.h"

  LaserScanToPointCloud(ros::NodeHandle n) : 
    n_(n),
    laser_sub_(n_, "base_scan", 10),
    laser_notifier_(laser_sub_,listener_, "base_link", 10)
  {
    laser_notifier_.registerCallback(
      boost::bind(&LaserScanToPointCloud::scanCallback, this, _1));
    laser_notifier_.setTolerance(ros::Duration(0.01));
    scan_pub_ = n_.advertise<sensor_msgs::PointCloud>("/my_cloud",1);
  }

  void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in)
  {
    sensor_msgs::PointCloud cloud;
    try
    {
        projector_.transformLaserScanToPointCloud(
          "base_link",*scan_in, cloud,listener_);
    }
    catch (tf::TransformException& e)
    {
        std::cout << e.what();
        return;
    }

    // Do something with cloud.

    scan_pub_.publish(cloud);

  }

My class.h :

#include "ros/ros.h"
#include "tf/transform_listener.h"
#include "sensor_msgs/PointCloud.h"
#include "tf/message_filter.h"
#include "message_filters/subscriber.h"
#include "laser_geometry/laser_geometry.h"

class LaserScanToPointCloud{

public:

  ros::NodeHandle n_;
  laser_geometry::LaserProjection projector_;
  tf::TransformListener listener_;
  message_filters::Subscriber<sensor_msgs::LaserScan> laser_sub_;
  tf::MessageFilter<sensor_msgs::LaserScan> laser_notifier_;
  ros::Publisher scan_pub_;

    //CONSTRUCTEUR
  LaserScanToPointCloud(ros::NodeHandle n);

    //METHODES
  void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in);

};

I have this undefined reference error :

test.cpp:(.text+0x154) : référence indéfinie vers « LaserScanToPointCloud::LaserScanToPointCloud(ros::NodeHandle) »

How can I use the class I created ? Should I change the Cmake ?

2019-02-12 09:43:38 -0600 commented answer Convert Scan to PointCloud, use .h files, undefined reference

It worked perfect when I merged my .h and .cpp class files in one file. Thank you very much :)

2019-02-12 08:04:39 -0600 asked a question Convert Scan to PointCloud, use .h files, undefined reference

Convert Scan to PointCloud, use .h files, undefined reference I follow the Laser Scanner data tutorial. I want to conver

2019-02-12 07:13:10 -0600 asked a question Undefined reference to ros::init

Undefined reference to ros::init I am following the Laser Scanner Data tutorial (http://wiki.ros.org/laser_pipeline/Tuto

2019-01-24 09:30:58 -0600 received badge  Famous Question (source)
2018-12-20 08:05:21 -0600 edited question Learning tf -- tf_echo Error -- World doesn't exist !!!

Learning tf -- tf_echo Error -- World doesn't exist !!! Ubuntu 18.04 -- ROS Melodic Following the learning_tf tutorial

2018-12-20 08:03:05 -0600 edited question Learning tf -- tf_echo Error -- World doesn't exist !!!

Learning tf -- tf_echo Error -- World doesn't exist !!! Ubuntu 18.04 -- ROS Melodic Following the learning_tf tutorial

2018-12-20 07:58:58 -0600 edited question Learning tf -- tf_echo Error -- World doesn't exist !!!

Learning tf -- tf_echo Error -- World doesn't exist !!! Ubuntu 18.04 -- ROS Melodic Following the learning_tf tutorial

2018-12-20 07:58:55 -0600 edited question Learning tf -- tf_echo Error -- World doesn't exist !!!

Learning tf tf_echo Error Ubuntu 18.04 -- ROS Melodic Following the learning_tf tutorial (http://wiki.ros.org/tf/Tutori

2018-12-20 07:58:27 -0600 edited question Learning tf -- tf_echo Error -- World doesn't exist !!!

Learning tf tf_echo Error Ubuntu 18.04 -- ROS Melodic Following the learning_tf tutorial (http://wiki.ros.org/tf/Tutori

2018-12-20 07:58:27 -0600 received badge  Editor (source)
2018-12-20 07:42:52 -0600 received badge  Supporter (source)
2018-12-20 07:27:23 -0600 asked a question Learning tf -- tf_echo Error -- World doesn't exist !!!

Learning tf tf_echo Error Following the learning_tf tutorial (http://wiki.ros.org/tf/Tutorials/Writing%20a%20tf%20broadc

2018-12-20 07:21:04 -0600 received badge  Popular Question (source)
2018-12-20 07:01:29 -0600 answered a question learning_tf CMake Error Melodic

To fix the problem, I had to : Put my learning_tf folder in my catkin_ws/src folder. Paste my turtle_tf_broadcaster.cpp

2018-12-20 05:47:36 -0600 commented question learning_tf CMake Error Melodic

Ok i found the solution ! thank you for your help !

2018-12-20 05:45:31 -0600 commented question learning_tf CMake Error Melodic

Thanks for the answer. I can't save a file with src/ in its name so i just deleted this part.

2018-12-20 05:14:01 -0600 asked a question learning_tf CMake Error Melodic

learning_tf CMake Error Melodic Hi I'm following the learning_tf tutorial (http://wiki.ros.org/tf/Tutorials/Writing%20a%

2018-12-19 08:17:23 -0600 received badge  Notable Question (source)
2018-12-18 07:17:19 -0600 commented answer RVIZ Laser Scan Display

Thanks Pete, you were right but the fixed frame has to be : "base_laser_link" and not "base_link_laser" eheh :D

2018-12-18 07:16:24 -0600 marked best answer RVIZ Laser Scan Display

Hello,

I want to display a laser scan data I have, file Mapping1.bag from a ROS tutorial(http://wiki.ros.org/laser_pipeline/Tutorials/IntroductionToWorkingWithLaserScannerData). When I run the bag file and try to display it on RVIZ with the right topic, I am having an error message :

"Transform [sender=unknown_publisher] For frame [base_laser_link]: Fixed Frame [map] does not exist"

LaserScan status is on ERROR and nothing is displayed.

Any idea about this problem ?

2018-12-18 07:16:24 -0600 received badge  Scholar (source)
2018-12-18 07:05:02 -0600 edited question RVIZ Laser Scan Display

RVIZ Laser Scan Display Hello, I want to display a laser scan data I have, file Mapping1.bag from a ROS tutorial(http:/

2018-12-17 19:14:47 -0600 received badge  Popular Question (source)
2018-12-17 09:50:33 -0600 asked a question RVIZ Laser Scan Display

RVIZ LASER SCAN DISPLAY Hello, I want to display a laser scan data I have, file Mapping1.bag from a ROS tutorial. When