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

tommises's profile - activity

2020-09-09 13:53:02 -0500 received badge  Great Question (source)
2020-06-11 05:13:12 -0500 received badge  Notable Question (source)
2019-01-09 17:00:51 -0500 received badge  Popular Question (source)
2018-09-11 09:16:42 -0500 received badge  Good Question (source)
2018-05-14 03:50:58 -0500 received badge  Nice Question (source)
2017-09-09 17:44:47 -0500 received badge  Student (source)
2016-09-13 14:12:16 -0500 asked a question rviz on PC not reconnecting after robot reboot

I run rviz on a laptop PC and it communicates with the remote master on a robot. When I replace the robot battery and boot the robot, rviz stops receiving data and needs to be restarted each time. I would like to keep rviz receiving data after the robot is rebooted. How to achieve this?

2016-09-13 13:51:44 -0500 received badge  Famous Question (source)
2016-09-13 13:51:32 -0500 received badge  Supporter (source)
2016-08-30 22:40:42 -0500 received badge  Enthusiast
2016-07-28 12:22:48 -0500 received badge  Notable Question (source)
2016-07-14 11:33:24 -0500 received badge  Popular Question (source)
2016-07-11 13:38:12 -0500 asked a question tf2_ros::Buffer.transform() causes "undefined reference" errors

I am trying to use tf2_ros::Buffer.transform() and when trying to compile I am getting "undefined reference" errors from the linker. I don't link I'm missing any libraries, because tf2_ros::Buffer.lookupTransform() compiles just fine and I added all possible tf2 libraries. Am I doing something wrong or does it seem to be a bug?

Below is the code of my test node and error messages. And my entire test package is at https://github.com/tommises/ros-tf2-i...

For what it's worth, tf::TransformListener.transformPoint() works fine as well. Is there any risk in mixing tf and tf2?

  • ROS version: kinetic
  • OS: Ubuntu 16.04

#include <ros/ros.h>
#include <geometry_msgs/PointStamped.h>

#include <tf2_ros/transform_listener.h> 

tf2_ros::Buffer tfBuffer;

void ellipsevsCallback(const geometry_msgs::PointStamped::ConstPtr& point_raw){
    geometry_msgs::TransformStamped transformStamped;
    transformStamped = tfBuffer.lookupTransform("global", "local", ros::Time(0));

    geometry_msgs::PointStamped point_tf;
    /* This is the line which fails to compile. */
    tfBuffer.transform(*point_raw, point_tf, "local");
}

int main(int argc, char** argv){
    ros::init(argc, argv, "tf2_test_tf2_point");
    tf2_ros::TransformListener tfListener(tfBuffer);

    ros::NodeHandle node;
    ros::Subscriber topic_sub = node.subscribe("test/point", 1, &ellipsevsCallback);

    ros::spin();
    return 0;
};

linker errors

[100%] Linking CXX executable tf2_test_tf2_point
CMakeFiles/tf2_test_tf2_point.dir/src/tf2_test_tf2_point.cpp.o: In function `geometry_msgs::PointStamped_<std::allocator<void> >& tf2_ros::BufferInterface::transform<geometry_msgs::PointStamped_<std::allocator<void> > >(geometry_msgs::PointStamped_<std::allocator<void> > const&, geometry_msgs::PointStamped_<std::allocator<void> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Duration) const':
tf2_test_tf2_point.cpp:(.text._ZNK7tf2_ros15BufferInterface9transformIN13geometry_msgs13PointStamped_ISaIvEEEEERT_RKS6_S7_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3ros8DurationE[_ZNK7tf2_ros15BufferInterface9transformIN13geometry_msgs13PointStamped_ISaIvEEEEERT_RKS6_S7_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3ros8DurationE]+0x69): undefined reference to `ros::Time const& tf2::getTimestamp<geometry_msgs::PointStamped_<std::allocator<void> > >(geometry_msgs::PointStamped_<std::allocator<void> > const&)'
tf2_test_tf2_point.cpp:(.text._ZNK7tf2_ros15BufferInterface9transformIN13geometry_msgs13PointStamped_ISaIvEEEEERT_RKS6_S7_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3ros8DurationE[_ZNK7tf2_ros15BufferInterface9transformIN13geometry_msgs13PointStamped_ISaIvEEEEERT_RKS6_S7_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3ros8DurationE]+0x7b): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const& tf2::getFrameId<geometry_msgs::PointStamped_<std::allocator<void> > >(geometry_msgs::PointStamped_<std::allocator<void> > const&)'
tf2_test_tf2_point.cpp:(.text._ZNK7tf2_ros15BufferInterface9transformIN13geometry_msgs13PointStamped_ISaIvEEEEERT_RKS6_S7_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3ros8DurationE[_ZNK7tf2_ros15BufferInterface9transformIN13geometry_msgs13PointStamped_ISaIvEEEEERT_RKS6_S7_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3ros8DurationE]+0xc8): undefined reference to `void tf2::doTransform<geometry_msgs::PointStamped_<std::allocator<void> > >(geometry_msgs::PointStamped_<std::allocator<void> > const&, geometry_msgs::PointStamped_<std::allocator<void> >&, geometry_msgs::TransformStamped_<std::allocator<void> > const&)'
collect2: error: ld returned 1 exit status
tf2_test/CMakeFiles/tf2_test_tf2_point.dir/build.make:120: recipe for target 'tf2_test/tf2_test_tf2_point' failed
make[2]: *** [tf2_test/tf2_test_tf2_point] Error 1
CMakeFiles/Makefile2:1340: recipe for target 'tf2_test/CMakeFiles/tf2_test_tf2_point.dir/all' failed
make[1]: *** [tf2_test/CMakeFiles/tf2_test_tf2_point.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

and my CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(tf2_test)

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  roscpp
  rospy
  tf2
  tf2_bullet
  tf2_eigen
  tf2_geometry_msgs
  tf2_kdl
  tf2_msgs
  tf2_py
  tf2_ros
  tf2_sensor_msgs
  tf2_tools
  tf
)

include_directories(
  ${catkin_INCLUDE_DIRS}
)

add_executable(tf2_test_tf2_point src/tf2_test_tf2_point.cpp)
add_executable(tf2_test_tf1_point src/tf2_test_tf1_point.cpp)

target_link_libraries(tf2_test_tf2_point
  ${catkin_LIBRARIES}
)
target_link_libraries(tf2_test_tf1_point
  ${catkin_LIBRARIES}
)
2016-07-10 22:56:43 -0500 asked a question Transform point in tf2

I am trying to figure out how to transform a point using tf2. The code below does not compile. What am I doing wrong?

void positionCallback(const geometry_msgs::PointStamped::ConstPtr& position_raw){   
    geometry_msgs::PointStamped::Ptr position_tf = 
                                           boost::make_shared<geometry_msgs::PointStamped>();
    tfBuffer.transform(position_raw, position_tf, "local_fcu");
}