Skip to content

Commit 22d0e79

Browse files
committed
Add check for the negative acceleration value
Signed-off-by: Sai Kishor Kothakota <[email protected]>
1 parent d0d7d3a commit 22d0e79

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

urdf_parser/src/joint.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ bool parseJointLimits(JointLimits &jl, tinyxml2::XMLElement* config)
182182
{
183183
try {
184184
jl.acceleration = strToDouble(acceleration_str);
185+
if (jl.acceleration < 0.0)
186+
{
187+
CONSOLE_BRIDGE_logError("acceleration value (%s) is negative", velocity_str);
188+
return false;
189+
}
185190
} catch(std::runtime_error &) {
186191
CONSOLE_BRIDGE_logError("acceleration value (%s) is not a valid float", acceleration_str);
187192
return false;

0 commit comments

Comments
 (0)