the diffrence between tf and tf2

asked 2017-05-04 21:26:56 -0600

DaDaLee gravatar image

updated 2017-05-04 21:56:18 -0600

I wrote a node based on tf2, and I copied several lines of code based on tf into my node. Then it went wrong, it goes like this:

In file included from /home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:33:0:
/home/pantiq/robot/src/robot_localization/include/robot_localization/ros_filter.h:273:5: error: ‘TransformListener’ in namespace ‘tf2’ does not name a type
     tf2::TransformListener listener;
     ^
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp: In member function ‘void RobotLocalization::RosFilter<T>::imuCallback(const ConstPtr&, const string&, const RobotLocalization::CallbackData&, const RobotLocalization::CallbackData&, const RobotLocalization::CallbackData&)’:
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:421:1: error: ‘listener’ was not declared in this scope
 listener.transformPoint ( FID_CAR, posPtr, carposPtr );
 ^
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:458:1: error: ‘listener’ was not declared in this scope
 listener.transformPoint ( FID_CAR, twistPtr, cartwistPtr );
 ^
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp: In member function ‘void RobotLocalization::R


strong text


osFilter<t>::run()’: /home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:1756:14: error: ‘StampedTransform’ is not a member of ‘tf2’ tf2::StampedTransform(
^ make[2]: * [robot_localization/CMakeFiles/ros_filter.dir/src/ros_filter.cpp.o] Error 1 make[1]: [robot_localization/CMakeFiles/ros_filter.dir/all] Error 2 make: ** [all] Error 2 Invoking "make -j4 -l4" failed

Any tips wuuld be appreciated.

edit retag flag offensive close merge delete