tf2_ros::Buffer::canTransform() returning False for existing transformationWhat should main() return in C and C++?Is it possible to write a template to check for a function's existence?Qt is not executing functions correctly as the console doesDeleting pointer to object in unordered_mapLong time to return from a method C++Suggestions on how to approach averaging of objects detectedUsing cv::rgbd::Odometry::computeLive 2D laser scanner data in rospyHow to drive a brushless motor using a commercial ESC with ROS?RTabMap Cannot locate node
How to level a picture frame hung on a single nail?
What's the global, general word that stands for "center tone of a song"?
Calculate the Ultraradical
SOQL injection vulnerability issue
What are one's options when facing religious discrimination at the airport?
Why does `FindFit` fail so badly in this simple case?
How to identify whether a publisher is genuine or not?
Everyone Gets a Window Seat
GPLv3 forces us to make code available, but to who?
Does the 'java' command compile Java programs?
How to have hashes doubled _and_ things expanded?
Enlightenment finding me
How do we know neutrons have no charge?
The answer is a girl's name (my future granddaughter) - can anyone help?
Does Bank Manager's discretion still exist in Mortgage Lending
Realistically, how much do you need to start investing?
Why does it seem the best way to make a living is to invest in real estate?
Can an untrusted VPN client monitor my network activity?
Windows 10 deletes lots of tiny files super slowly. Can anything that be done to speed it up?
Booting Ubuntu from USB drive on MSI motherboard -- EVERYTHING fails
Isn't the detector always measuring, and thus always collapsing the state?
Replace zeros in a list with last nonzero value
How dangerous is a very out-of-true disc brake wheel?
How to say "respectively" in German when listing (enumerating) things
tf2_ros::Buffer::canTransform() returning False for existing transformation
What should main() return in C and C++?Is it possible to write a template to check for a function's existence?Qt is not executing functions correctly as the console doesDeleting pointer to object in unordered_mapLong time to return from a method C++Suggestions on how to approach averaging of objects detectedUsing cv::rgbd::Odometry::computeLive 2D laser scanner data in rospyHow to drive a brushless motor using a commercial ESC with ROS?RTabMap Cannot locate node
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I'm writing a package that, among other things, needs to get a transformation from the /base_laser frame to the (world) /odom frame. Both frames exist, and rosrun tf tf_echo /odom /base_laser returns the correct transformation values. The problem appears when I try to get the transformation using a TransformListener in my node; in this case, canTransform() always returns false.
The code is part of a test using the husky_simulator package to get the laser measurements and the environment.
This is the relevant part of the code:
tf2_ros::Buffer tfBuffer;
tf2_ros::TransformListener tfListener(tfBuffer);
geometry_msgs::TransformStamped transformStamped;
try
ros::Time now = ros::Time::now();
if (tfBuffer.canTransform("odom",
"base_laser",
now,
ros::Duration(0.01)))
transformStamped = tfBuffer.lookupTransform("odom",
"base_laser",
now);
ROS_INFO("canTransform: TRUE");
ROS_INFO("Transform: [%.2f, %.2f, %.2f]",
transformStamped.transform.translation.x,
transformStamped.transform.translation.y,
transformStamped.transform.translation.z);
else
ROS_INFO("canTransform: FALSE");
catch (tf2::TransformException &ex)
ROS_WARN("%s", ex.what());
ros::Duration(1);
When launching the node, the output shows the following:
[ INFO] [1553804232.701323614, 0.176000000]: canTransform: FALSE
[ INFO] [1553804232.736923460, 0.207000000]: canTransform: FALSE
[ INFO] [1553804232.813116964, 0.275000000]: canTransform: FALSE
[ INFO] [1553804232.856465945, 0.311000000]: canTransform: FALSE
[ INFO] [1553804232.923821528, 0.365000000]: canTransform: FALSE
[ INFO] [1553804233.977405692, 0.397000000]: canTransform: FALSE
and keeps this way, without returning a true.
This code is inside a function that is called periodically from the node main function. Everything else works as expected.
Running ROS Melodic in Ubuntu 18.04
Any help is welcome.
c++ ros
add a comment
|
I'm writing a package that, among other things, needs to get a transformation from the /base_laser frame to the (world) /odom frame. Both frames exist, and rosrun tf tf_echo /odom /base_laser returns the correct transformation values. The problem appears when I try to get the transformation using a TransformListener in my node; in this case, canTransform() always returns false.
The code is part of a test using the husky_simulator package to get the laser measurements and the environment.
This is the relevant part of the code:
tf2_ros::Buffer tfBuffer;
tf2_ros::TransformListener tfListener(tfBuffer);
geometry_msgs::TransformStamped transformStamped;
try
ros::Time now = ros::Time::now();
if (tfBuffer.canTransform("odom",
"base_laser",
now,
ros::Duration(0.01)))
transformStamped = tfBuffer.lookupTransform("odom",
"base_laser",
now);
ROS_INFO("canTransform: TRUE");
ROS_INFO("Transform: [%.2f, %.2f, %.2f]",
transformStamped.transform.translation.x,
transformStamped.transform.translation.y,
transformStamped.transform.translation.z);
else
ROS_INFO("canTransform: FALSE");
catch (tf2::TransformException &ex)
ROS_WARN("%s", ex.what());
ros::Duration(1);
When launching the node, the output shows the following:
[ INFO] [1553804232.701323614, 0.176000000]: canTransform: FALSE
[ INFO] [1553804232.736923460, 0.207000000]: canTransform: FALSE
[ INFO] [1553804232.813116964, 0.275000000]: canTransform: FALSE
[ INFO] [1553804232.856465945, 0.311000000]: canTransform: FALSE
[ INFO] [1553804232.923821528, 0.365000000]: canTransform: FALSE
[ INFO] [1553804233.977405692, 0.397000000]: canTransform: FALSE
and keeps this way, without returning a true.
This code is inside a function that is called periodically from the node main function. Everything else works as expected.
Running ROS Melodic in Ubuntu 18.04
Any help is welcome.
c++ ros
add a comment
|
I'm writing a package that, among other things, needs to get a transformation from the /base_laser frame to the (world) /odom frame. Both frames exist, and rosrun tf tf_echo /odom /base_laser returns the correct transformation values. The problem appears when I try to get the transformation using a TransformListener in my node; in this case, canTransform() always returns false.
The code is part of a test using the husky_simulator package to get the laser measurements and the environment.
This is the relevant part of the code:
tf2_ros::Buffer tfBuffer;
tf2_ros::TransformListener tfListener(tfBuffer);
geometry_msgs::TransformStamped transformStamped;
try
ros::Time now = ros::Time::now();
if (tfBuffer.canTransform("odom",
"base_laser",
now,
ros::Duration(0.01)))
transformStamped = tfBuffer.lookupTransform("odom",
"base_laser",
now);
ROS_INFO("canTransform: TRUE");
ROS_INFO("Transform: [%.2f, %.2f, %.2f]",
transformStamped.transform.translation.x,
transformStamped.transform.translation.y,
transformStamped.transform.translation.z);
else
ROS_INFO("canTransform: FALSE");
catch (tf2::TransformException &ex)
ROS_WARN("%s", ex.what());
ros::Duration(1);
When launching the node, the output shows the following:
[ INFO] [1553804232.701323614, 0.176000000]: canTransform: FALSE
[ INFO] [1553804232.736923460, 0.207000000]: canTransform: FALSE
[ INFO] [1553804232.813116964, 0.275000000]: canTransform: FALSE
[ INFO] [1553804232.856465945, 0.311000000]: canTransform: FALSE
[ INFO] [1553804232.923821528, 0.365000000]: canTransform: FALSE
[ INFO] [1553804233.977405692, 0.397000000]: canTransform: FALSE
and keeps this way, without returning a true.
This code is inside a function that is called periodically from the node main function. Everything else works as expected.
Running ROS Melodic in Ubuntu 18.04
Any help is welcome.
c++ ros
I'm writing a package that, among other things, needs to get a transformation from the /base_laser frame to the (world) /odom frame. Both frames exist, and rosrun tf tf_echo /odom /base_laser returns the correct transformation values. The problem appears when I try to get the transformation using a TransformListener in my node; in this case, canTransform() always returns false.
The code is part of a test using the husky_simulator package to get the laser measurements and the environment.
This is the relevant part of the code:
tf2_ros::Buffer tfBuffer;
tf2_ros::TransformListener tfListener(tfBuffer);
geometry_msgs::TransformStamped transformStamped;
try
ros::Time now = ros::Time::now();
if (tfBuffer.canTransform("odom",
"base_laser",
now,
ros::Duration(0.01)))
transformStamped = tfBuffer.lookupTransform("odom",
"base_laser",
now);
ROS_INFO("canTransform: TRUE");
ROS_INFO("Transform: [%.2f, %.2f, %.2f]",
transformStamped.transform.translation.x,
transformStamped.transform.translation.y,
transformStamped.transform.translation.z);
else
ROS_INFO("canTransform: FALSE");
catch (tf2::TransformException &ex)
ROS_WARN("%s", ex.what());
ros::Duration(1);
When launching the node, the output shows the following:
[ INFO] [1553804232.701323614, 0.176000000]: canTransform: FALSE
[ INFO] [1553804232.736923460, 0.207000000]: canTransform: FALSE
[ INFO] [1553804232.813116964, 0.275000000]: canTransform: FALSE
[ INFO] [1553804232.856465945, 0.311000000]: canTransform: FALSE
[ INFO] [1553804232.923821528, 0.365000000]: canTransform: FALSE
[ INFO] [1553804233.977405692, 0.397000000]: canTransform: FALSE
and keeps this way, without returning a true.
This code is inside a function that is called periodically from the node main function. Everything else works as expected.
Running ROS Melodic in Ubuntu 18.04
Any help is welcome.
c++ ros
c++ ros
edited Apr 1 at 16:16
davidvg
asked Mar 28 at 20:21
davidvgdavidvg
64 bronze badges
64 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
I finally found what was going on: the husky_simulator code uses tf while I was trying to get the transforms using tf2; once I switched to tf, the transform was found.
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406243%2ftf2-rosbuffercantransform-returning-false-for-existing-transformation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I finally found what was going on: the husky_simulator code uses tf while I was trying to get the transforms using tf2; once I switched to tf, the transform was found.
add a comment
|
I finally found what was going on: the husky_simulator code uses tf while I was trying to get the transforms using tf2; once I switched to tf, the transform was found.
add a comment
|
I finally found what was going on: the husky_simulator code uses tf while I was trying to get the transforms using tf2; once I switched to tf, the transform was found.
I finally found what was going on: the husky_simulator code uses tf while I was trying to get the transforms using tf2; once I switched to tf, the transform was found.
answered Apr 1 at 16:19
davidvgdavidvg
64 bronze badges
64 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406243%2ftf2-rosbuffercantransform-returning-false-for-existing-transformation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown