Skip to content

Commit

Permalink
revert mimic joints
Browse files Browse the repository at this point in the history
  • Loading branch information
mamueluth committed Jun 3, 2024
1 parent 52e5571 commit a18bbc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ struct MimicJoint
enum class MimicAttribute
{
NOT_SET,
MIMIC,
NO_MIMIC
TRUE,
FALSE
};

/**
* This structure stores information about components defined for a specific hardware
* in robot's URDF.
Expand Down
8 changes: 4 additions & 4 deletions hardware_interface/src/component_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ ComponentInfo parse_component_from_xml(const tinyxml2::XMLElement * component_it
try
{
component.is_mimic = parse_bool(get_attribute_value(component_it, kMimicAttribute, kJointTag))
? MimicAttribute::MIMIC
: MimicAttribute::NO_MIMIC;
? MimicAttribute::TRUE
: MimicAttribute::FALSE;
}
catch (const std::runtime_error & e)
{
Expand Down Expand Up @@ -692,12 +692,12 @@ std::vector<HardwareInfo> parse_control_resources_from_urdf(const std::string &
{
throw std::runtime_error("Joint " + joint.name + " not found in URDF");
}
if (!urdf_joint->mimic && joint.is_mimic == MimicAttribute::MIMIC)
if (!urdf_joint->mimic && joint.is_mimic == MimicAttribute::TRUE)
{
throw std::runtime_error(
"Joint '" + joint.name + "' has no mimic information in the URDF.");
}
if (urdf_joint->mimic && joint.is_mimic != MimicAttribute::NO_MIMIC)
if (urdf_joint->mimic && joint.is_mimic != MimicAttribute::FALSE)
{
if (joint.command_interfaces.size() > 0)
{
Expand Down

0 comments on commit a18bbc2

Please sign in to comment.