turtlebot3 icon indicating copy to clipboard operation
turtlebot3 copied to clipboard

May I know how we can obtain transforms of the bot? I want to obtain frame ids, similar to using hector_trajectory_server used in ROS

Open ROBOTIS-Will opened this issue 3 years ago • 8 comments

May I know how we can obtain transforms of the bot? I want to obtain frame ids, similar to using hector_trajectory_server used in ROS

Originally posted by @akshay-30 in https://github.com/ROBOTIS-GIT/turtlebot3/issues/512#issuecomment-890928829

ROBOTIS-Will avatar Aug 06 '21 00:08 ROBOTIS-Will

@akshay-30

You can read a specific frame_id in /tf topic. Some of the the transform of the hardware attached to the robot are published via the /tf_static topic.

ROBOTIS-Will avatar Aug 06 '21 00:08 ROBOTIS-Will

I tried to read the odom frame and the base_link frame. And publish the frame ids , but I'm getting a error of invalid frame is passed in canTransform : odom frame (target frame) does not exist.

akshay-30 avatar Aug 06 '21 02:08 akshay-30

I'm using ubuntu 20.04 version on my laptop, and running ros2 foxy. I have tried to port hector_trajectory_server to ros2. Just want to test it on turtlebot3.

akshay-30 avatar Aug 06 '21 02:08 akshay-30

While TurtleBot3 is running the Bringup node, you can read the /tf and will return both odom and base_link as below. image

ROBOTIS-Will avatar Aug 09 '21 04:08 ROBOTIS-Will

I'm trying to read the frame ids through tf2_ros::TransformListener, passing it into tf2_ros::Buffer. But canTransform and lookupTransform functions are not able to find the target frame ids. I get the error - frame does not exist

akshay-30 avatar Aug 09 '21 08:08 akshay-30

Nevermind, I found the bug in my code and was able to debug it with some help. I wasn't passing the right parameters into lookuptransform. Now I am getting the right frame ids and their transforms. Thanks for the help @ROBOTIS-Will

akshay-30 avatar Aug 10 '21 06:08 akshay-30

@akshay-30 Looks like you haven't correctly installed the package or didn't source the correct working space. Make sure to install all the necessary packages to run the TurtleBot3.

ROBOTIS-Will avatar Aug 10 '21 06:08 ROBOTIS-Will

For installation I followed the tutorial itself. And have sourced it properly. turtlebot3_gazebo, turtlebot3_navigation, turtlebot3_teleop are all building properly except turtlebot3_bringup

akshay-30 avatar Aug 10 '21 06:08 akshay-30