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

RosFan19's profile - activity

2023-06-06 03:56:27 -0500 received badge  Good Question (source)
2021-08-06 23:37:06 -0500 received badge  Nice Question (source)
2020-09-07 04:33:34 -0500 received badge  Famous Question (source)
2019-08-05 15:12:47 -0500 marked best answer Including pcl_ros for transformPointCloud

Hi,

So I'm trying to use pcl_ros method:

transformPointCloud (const std::string &target_frame, const sensor_msgs::PointCloud2 &in, sensor_msgs::PointCloud2 &out, const tf::TransformListener &tf_listener)

from http://docs.ros.org/api/pcl_ros/html/...

But I'm not sure what pcl_ros/... to include. Like msot things, it doesn't seem to be under #include <pcl_ros/point_cloud.h>

2018-07-18 08:41:33 -0500 received badge  Famous Question (source)
2018-07-18 08:41:33 -0500 received badge  Notable Question (source)
2018-07-18 08:41:33 -0500 received badge  Popular Question (source)
2018-03-16 03:40:06 -0500 received badge  Famous Question (source)
2018-03-16 03:40:06 -0500 received badge  Notable Question (source)
2017-04-20 05:47:29 -0500 received badge  Famous Question (source)
2017-03-21 14:11:44 -0500 marked best answer Error: Lookup would require extrapolation into the past.

Hi,

I seem to be getting the error:

Lookup would require extrapolation into the past. Requested time 1424871421.389785282 but the earliest data is at time 1424871421.599770804, when looking up transform from frame [base_link] to frame [camera_depth_optical_frame] Aborted (core dumped)

Here is my code:

  void callback(const sensor_msgs::PointCloud2::ConstPtr& msg)
  {

    tf::Transform cameraTransform;
    cameraTransform.setOrigin( tf::Vector3(0.0, 0.0, 0.0) );
    tf::Quaternion q;
    q.setRPY(0, 0, 0);
    cameraTransform.setRotation(q);
    br.sendTransform(tf::StampedTransform(cameraTransform, msg->header.stamp, "xtion_link", "camera_link"));

    tf::StampedTransform transform;
    if (waitOnTransform == false) {
      listener.waitForTransform("camera_depth_optical_frame", "base_link", ros::Time(0), ros::Duration(10.0) );
      waitOnTransform = true;
    }
    listener.lookupTransform("camera_depth_optical_frame", "base_link", ros::Time(0), transform);

    pcl_ros::transformPointCloud(*base_link, transform, *msg, *msgOut);

Where camera_depth is the subframe of camera_link and xtion_link the subframe of base_link. So I'm creating the link first between camera_link and xtion_link and then try to get the transform. The problem should be solved by lookUpTransform, but it seems that waitForTransform is not working for some reason.

And when I remove the waitForTransform, I still get the error that Requested time 1424871421.389785282, while it should be 10 seconds later.

2017-03-21 14:11:44 -0500 received badge  Self-Learner (source)
2016-10-25 05:38:40 -0500 received badge  Notable Question (source)
2016-10-25 05:38:40 -0500 received badge  Popular Question (source)
2016-09-20 22:45:44 -0500 received badge  Famous Question (source)
2016-09-12 10:36:07 -0500 received badge  Popular Question (source)
2016-09-12 10:36:07 -0500 received badge  Notable Question (source)
2016-09-12 10:36:07 -0500 received badge  Notable Question (source)
2016-09-12 10:36:07 -0500 received badge  Famous Question (source)
2016-09-12 10:36:07 -0500 received badge  Popular Question (source)
2016-07-10 22:23:14 -0500 received badge  Notable Question (source)
2016-02-10 04:57:48 -0500 received badge  Famous Question (source)
2016-02-10 04:57:48 -0500 received badge  Notable Question (source)
2016-02-10 04:57:48 -0500 received badge  Popular Question (source)
2015-11-27 04:02:35 -0500 received badge  Nice Question (source)
2015-10-27 09:57:16 -0500 received badge  Famous Question (source)
2015-10-26 03:30:09 -0500 commented answer Error: Invalid argument passed to canTransform argument source_frame

I have the code right here: https://github.com/Jyrks/visual_servo...

I solved it by using the swap method, since using just the header doesn't change all the necessary fields.

Look for the part:

cloud_filtered->swap(*filtered_cloud_cluster);

2015-10-12 17:24:37 -0500 received badge  Notable Question (source)
2015-07-14 10:49:15 -0500 received badge  Nice Question (source)
2015-07-06 14:59:10 -0500 received badge  Popular Question (source)
2015-06-23 17:25:10 -0500 marked best answer Installing PCL for ROS Indigo

I have installed the latest PCL on Ubuntu 14.04 ROS Indigo, using the website: http://pointclouds.org/downloads/linu...

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl

sudo apt-get update

sudo apt-get install libpcl-all

Added to CMake:

find_package (PCL REQUIRED) ...

include_directories(${PCL_INCLUDE_DIRS}) ...

etc

But I get an error at find_package method saying that:

Could not find a package configuration file provided by "PCL" with any of the following names:

PCLConfig.cmake
pcl-config.cmake

Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR" to a directory containing one of the above files. If "PCL" provides a separate development package or SDK, be sure it has been installed.

Meaning that PCL was not installed correctly. Now my question is that what did I miss during the course of installation or did I mistype something when finding packages?

2015-06-14 07:44:30 -0500 received badge  Famous Question (source)
2015-05-20 11:14:00 -0500 received badge  Famous Question (source)
2015-05-19 02:20:00 -0500 received badge  Notable Question (source)
2015-05-14 14:55:48 -0500 asked a question Using msgs from the same package

Hi,

I'm trying to use msgs from the current package. So usually it's like this, when I'm using a different package:

#include package_name/msg_name
pub_ = nh_.advertise<project_name::msg_name>("topic", 1);

But I'm trying to use the msg I created in the same project package Let's say my package name is first_package and msg is first_msg, but doing so:

#include first_package/first_msg
pub_ = nh_.advertise<first_project::first_msg>("topic", 1);

Doesnt seem to work. Well why should I import something that is already in my package. What is the correct syntax here?

2015-05-13 00:57:45 -0500 received badge  Famous Question (source)
2015-04-30 15:13:28 -0500 asked a question Showing image with 2 channels

Hi,

I'm using goodFeaturesToTrack() method to locate corners from an image. However when I try to view the image, using imshow(), I get an error:

OpenCV Error: Bad number of channels (Source image must have 1, 3 or 4 channels) in cvConvertImage

Here is the code:

Mat outPutImage;
goodFeaturesToTrack(src_gray, outPutImage, 20, 0.5, 500);
imshow("Output", outPutImage);

goodFeaturesToTrack takes in only a 1 channel image and outputs a 2 channel image. How can I convert the 2 channel to 3 channel or is there an alternative for imshow?

2015-04-27 03:37:32 -0500 asked a question Roslaunch cannot find launch file after Visp_ros install

Hi,

So I installed visp_ros package using the instructions here:

http://wiki.ros.org/visp_ros/Tutorial...

After the installation i cannot roslaunch a launch file that is in the catkin workspace and worked perfectly before the visp_ros installation. This is the error:

[launch_file_name.launch] is neither a launch file in package [package_name] nor is [launch_file_name] a launch file name

And when I go directly to the src and type: roslaunch launch_file_name, I get the error:

ERROR: cannot launch node of type package_name/launch_file_name]: can't locate node [node_name] in package [cluster_extraction]

I have source /home/user_name/catkin_ws/devel/setup.sh in .bashrc file.

2015-04-26 19:37:22 -0500 marked best answer Transforming Point Cloud

Hi,

I'm trying to transform a Point Cloud from one frame to another. I'm using the method:

transformPointCloud (const std::string &target_frame, const tf::Transform &net_transform, const sensor_msgs::PointCloud2 &in, sensor_msgs::PointCloud2 &out)

I have built a transform tree and it works great. I can see well transformed image in rviz using base_link as map. I need to do some calculations on the PointCloud2 data so i need the points transformed to camera_depth frame. However when I use this method I'm not getting the result needed when I visualize the camera_depth, the image is tilted and not straight as in base_link.

listener.lookupTransform(*camera_depth, *base_link, ros::Time(0), transform);

pcl_ros::transformPointCloud(*camera_depth, transform, *msg, *msgOut);
2015-04-20 13:06:36 -0500 marked best answer Using two topic's information in a subscriber's callback

Hi,

I have a design problem.

I have a topic with an image, that needs to be analyzed and I need to get a certain coordinate from it. I also have another topic with a certain coordinate.

I need to use both of those coordinates in a callback method. So let's say I have a subscriber's callback:

callback(imageInfo) {
    //I only get the imageinfo here
}

So I get the imageinfo there but I need to use the certain coordinate info also, to calculate a result. I could create a global variable for the certain coordinate and have a different subscriber with a callback setting its value and then use the global variable in the callback(imageinfo).

But is there a better way? It doesn't seem that good.

2015-04-20 13:06:33 -0500 commented answer Using two topic's information in a subscriber's callback

This is exactly what I needed. Thanks!