-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only the integer part of the float matters in sizes! #21
Comments
I just realized that I am experiencing the same bug for origin values too! |
Hi @gstavrinos, would you mind posting steps to reproduce? I'm unable to reproduce it. I added this test to one of the test files. TEST(model_parser_initxml, floating_point_values)
{
static const std::string good_robot{"<robot name=\"myrobot\">"
" <link name=\"one_link\">"
" <visual>"
" <origin xyz=\"1.2 1.3 1.4\" rpy=\"0.2 0.3 0.4\"/>"
" <geometry>"
" <box size=\"1.2 1.3 1.4\"/>"
" </geometry>"
" </visual>"
" </link>"
"</robot>"};
urdf::Model model;
ASSERT_TRUE(model.initString(good_robot));
auto pose = model.getLink("one_link")->visual->origin;
EXPECT_DOUBLE_EQ(1.2, pose.position.x);
EXPECT_DOUBLE_EQ(1.3, pose.position.y);
EXPECT_DOUBLE_EQ(1.4, pose.position.z);
auto * box_geometry = dynamic_cast<urdf::Box *>(model.getLink("one_link")->visual->geometry.get());
EXPECT_DOUBLE_EQ(1.2, box_geometry->dim.x);
EXPECT_DOUBLE_EQ(1.3, box_geometry->dim.y);
EXPECT_DOUBLE_EQ(1.4, box_geometry->dim.z);
} And it appears to work fine when running
|
Are you using a locale that uses There is also a workaround at ros-visualization/rviz#1151 (comment) |
I am currently in a ROS Kinetic machine, and I can't reproduce the problem. I will post a proper comment as soon as I get my hands on my ROS Melodic machine. What I can say for now, is that the same urdf file was working on Kinetic but wasn't on Melodic. It could be a locale thingy of the OS setup. I will check that too, and get back to both of you. Thanks for your help, guys. |
I confirm that the links Mike sent are related to the bug I am experiencing. The workaround is not working, but at least I know where to look for a future fix. Seems like Kinetic will have to stay for some time! Thanks you both! |
* Work around Windows min/max bug. The comments in the code explain why we need this. Signed-off-by: Chris Lalancette <[email protected]>
A simple example to show this bug is the following:
`
`
The example above works like a charm. If you use the following, the y dimension is equal to 0, even though it should be 0.9:
`
`
Finally, with this description the box is completely invisible:
`
I am using a super vanilla version of ROS Melodic.
The text was updated successfully, but these errors were encountered: