[ros-users] Frame questions
Dejan Pangercic
dejan.pangercic at gmail.com
Wed Mar 17 16:21:31 UTC 2010
Hey Todd,
what exactly is the question, you do not understand the code?
Can you post the whole h/cpp files?
Do you have some laser scan data in a bag file we could try the code on?
cheers,
On Wed, Mar 17, 2010 at 5:00 PM, Todd Anderson <tdansel88 at gmail.com> wrote:
> Hello, I am trying to use the point cloud on laser data... but the
> transform/frame stuff is messing with me. I want to be able to get points
> with reference to the robot and points with reference to the fixed frame
> map. Currently I am looking up the transform between base_laser_link and
> odom which outputs points in a manner that is beyond my spatial
> understanding. Here is the code:
> static tf::TransformListener tf_listener;
> //const sensor_msgs::LaserScan::ConstPtr msg_in_myframe =
> tf_listener.transformPoint(
> // Get the transform from the laser frame to the odometry frame
> tf::StampedTransform transform;
> try {
> tf_listener.lookupTransform(msg->header.frame_id, "odom", ros::Time(),
> transform);
>
> // Turn the laser scan into a point cloud, in the odom coordinate frame
> sensor_msgs::PointCloud point_cloud;
> laser_projection.transformLaserScanToPointCloud("odom", *msg,
> point_cloud, tf_listener);
>
> for(vector<geometry_msgs::Point32>::iterator it =
> point_cloud.points.begin(); it != point_cloud.points.end(); ++it)
> ss << it->x << ' '<< it->y << endl;
> } catch (tf::TransformException &ex){
> ROS_ERROR("%s", ex.what());
> }
> --
> Todd Anderson
> (919) 710-0546
> Washington University in St. Louis Class of 2011
> School of Engineering and Applied Sciences
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
--
MSc. Dejan Pangercic
PhD Student/Researcher
Computer Science IX
Technische Universität München
Telephone: +49 (89) 289-17780
E-Mail: dejan.pangercic at in.tum.de
WWW: http://ias.cs.tum.edu/people/pangercic
More information about the ros-users
mailing list