File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,10 @@ TransmissionInfo parse_transmission_from_xml(const tinyxml2::XMLElement * transm
411
411
// Find name, type and class of a transmission
412
412
transmission.name = get_attribute_value (transmission_it, kNameAttribute , transmission_it->Name ());
413
413
const auto * type_it = transmission_it->FirstChildElement (kClassTypeTag );
414
+ if (!type_it)
415
+ {
416
+ throw std::runtime_error (" Missing <plugin> tag of <transmission> element in your URDF." );
417
+ }
414
418
transmission.type = get_text_for_element (type_it, kClassTypeTag );
415
419
416
420
// Parse joints
@@ -515,6 +519,10 @@ HardwareInfo parse_resource_from_xml(
515
519
if (!std::string (kHardwareTag ).compare (ros2_control_child_it->Name ()))
516
520
{
517
521
const auto * type_it = ros2_control_child_it->FirstChildElement (kClassTypeTag );
522
+ if (!type_it)
523
+ {
524
+ throw std::runtime_error (" Missing <plugin> tag of <hardware> element in your URDF." );
525
+ }
518
526
hardware.hardware_class_type =
519
527
get_text_for_element (type_it, std::string (" hardware " ) + kClassTypeTag );
520
528
const auto * params_it = ros2_control_child_it->FirstChildElement (kParamTag );
You can’t perform that action at this time.
0 commit comments