Skip to content

Commit ff06de3

Browse files
committed
fixed formatting
Signed-off-by: Aditya Agrawal <[email protected]>
1 parent 640766f commit ff06de3

File tree

2 files changed

+41
-42
lines changed

2 files changed

+41
-42
lines changed

src/parser_urdf.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,14 +2108,14 @@ void InsertSDFExtensionVisual(tinyxml2::XMLElement *_elem,
21082108
void InsertSDFExtensionLink(tinyxml2::XMLElement *_elem,
21092109
const std::string &_linkName)
21102110
{
2111-
bool link_found = false;
2111+
bool link_found = false;
21122112
for (StringSDFExtensionPtrMap::iterator
21132113
sdfIt = g_extensions.begin();
21142114
sdfIt != g_extensions.end(); ++sdfIt)
21152115
{
21162116
if (sdfIt->first == _linkName)
21172117
{
2118-
link_found = true;
2118+
link_found = true;
21192119
sdfdbg << "inserting extension with reference ["
21202120
<< _linkName << "] into link.\n";
21212121
for (std::vector<SDFExtensionPtr>::iterator ge =
@@ -2155,13 +2155,13 @@ void InsertSDFExtensionLink(tinyxml2::XMLElement *_elem,
21552155
}
21562156
}
21572157
}
2158-
2159-
// If we didn't find the link, emit a warning
2160-
if (!link_found) {
2161-
sdfwarn << "<gazebo> tag with reference[" << _linkName << "] does not exist in the URDF model. Please "
2162-
<< "ensure that the referenced attribute matches the name of a link, consider checking unicode "
2163-
<< "representation for reference attribute in case of invisible characters and homoglyphs";
2164-
}
2158+
2159+
// If we didn't find the link, emit a warning
2160+
if (!link_found) {
2161+
sdfwarn << "<gazebo> tag with reference[" << _linkName << "] does not exist"
2162+
<< " in the URDF model. Please ensure that the reference attribute"
2163+
<< " matches the name of a link.";
2164+
}
21652165
}
21662166

21672167
////////////////////////////////////////////////////////////////////////////////

src/parser_urdf_TEST.cc

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ TEST(URDFParser, ZeroMassLeafLink)
24632463
/////////////////////////////////////////////////
24642464
TEST(URDFParser, ParseGazeboRefDoesntExistWarningMessage)
24652465
{
2466-
// Redirect sdfwarn output
2466+
// Redirect sdfwarn output
24672467
std::stringstream buffer;
24682468
sdf::testing::RedirectConsoleStream redir(
24692469
sdf::Console::Instance()->GetMsgStream(), &buffer);
@@ -2476,46 +2476,45 @@ TEST(URDFParser, ParseGazeboRefDoesntExistWarningMessage)
24762476
});
24772477
#endif
24782478

2479-
// test if reference to link exists
2480-
{
2481-
// clear the contents of the buffer
2479+
// test if reference to link exists
2480+
{
2481+
// clear the contents of the buffer
24822482
buffer.str("");
24832483

24842484
std::string str = R"(
2485-
<robot name="test_robot">
2486-
<link name="link1">
2487-
<inertial>
2488-
<mass value="1" />
2489-
<inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01" />
2490-
</inertial>
2491-
</link>
2492-
<gazebo reference="lіnk1">
2493-
<sensor name="link1_imu" type="imu">
2494-
<always_on>1</always_on>
2495-
<update_rate>100</update_rate>
2496-
<pose>0.13525 0 -0.07019999999999993 0.0 -0.0 -2.0943952105869315</pose>
2497-
<plugin name="sensor_plugin" filename="example_plugin.so" />
2498-
</sensor>
2499-
</gazebo>
2500-
</robot>
2501-
)";
2485+
<robot name="test_robot">
2486+
<link name="link1">
2487+
<inertial>
2488+
<mass value="1" />
2489+
<inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01" />
2490+
</inertial>
2491+
</link>
2492+
<gazebo reference="lіnk1">
2493+
<sensor name="link1_imu" type="imu">
2494+
<always_on>1</always_on>
2495+
<update_rate>100</update_rate>
2496+
<pose>0.13525 0 -0.07019999999999993 0.0 -0.0 -2.0943952105869315</pose>
2497+
<plugin name="sensor_plugin" filename="example_plugin.so" />
2498+
</sensor>
2499+
</gazebo>
2500+
</robot>)";
25022501

25032502
sdf::URDF2SDF parser;
25042503
tinyxml2::XMLDocument sdfResult;
25052504
sdf::ParserConfig config;
25062505
parser.InitModelString(str, config, &sdfResult);
2507-
2508-
EXPECT_PRED2(sdf::testing::contains, buffer.str(),
2509-
"<gazebo> tag with reference[link1] does not exist in the URDF model. Please "
2510-
"ensure that the referenced attribute matches the name of a link, consider checking unicode "
2511-
"representation for reference attribute in case of invisible characters and homoglyphs");
2512-
}
2513-
2514-
// TODO: Similar tests for -
2515-
// InsertSDFExtensionCollision,
2516-
// InsertSDFExtensionRobot,
2517-
// InsertSDFExtensionVisual,
2518-
// InsertSDFExtensionJoint
2506+
2507+
EXPECT_PRED2(sdf::testing::contains, buffer.str(),
2508+
"<gazebo> tag with reference[" << _linkName << "] does not exist"
2509+
" in the URDF model. Please ensure that the reference attribute"
2510+
" matches the name of a link.");
2511+
}
2512+
2513+
/* TODO(aagrawal05): Similar tests for -
2514+
InsertSDFExtensionCollision,
2515+
InsertSDFExtensionRobot,
2516+
InsertSDFExtensionVisual,
2517+
InsertSDFExtensionJoint */
25192518
}
25202519

25212520
/////////////////////////////////////////////////

0 commit comments

Comments
 (0)