Skip to content
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

Correct formatting of JointLimits URDF file. #1339

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions joint_limits/include/joint_limits/joint_limits_urdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

/// \author Adolfo Rodriguez Tsouroukdissian

#ifndef JOINT_LIMITS_URDF_HPP
#define JOINT_LIMITS_URDF_HPP
#ifndef JOINT_LIMITS__JOINT_LIMITS_URDF_HPP_
#define JOINT_LIMITS__JOINT_LIMITS_URDF_HPP_

#include "joint_limits/joint_limits.hpp"
#include "urdf_model/joint.h"
Expand Down Expand Up @@ -82,4 +82,4 @@ inline bool getSoftJointLimits(urdf::JointConstSharedPtr urdf_joint, SoftJointLi
return true;
}
} // namespace joint_limits
#endif // JOINT_LIMITS_URDF_HPP
#endif // JOINT_LIMITS__JOINT_LIMITS_URDF_HPP_
19 changes: 8 additions & 11 deletions joint_limits/test/joint_limits_urdf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "gtest/gtest.h"

using std::string;
using namespace joint_limits;

class JointLimitsUrdfTest : public ::testing::Test
{
Expand Down Expand Up @@ -53,14 +52,14 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
// Unset URDF joint
{
JointLimits limits;
joint_limits::JointLimits limits;
urdf::JointSharedPtr urdf_joint_bad;
EXPECT_FALSE(getJointLimits(urdf_joint_bad, limits));
}

// Unset URDF limits
{
JointLimits limits;
joint_limits::JointLimits limits;
urdf::JointSharedPtr urdf_joint_bad(new urdf::Joint);
EXPECT_FALSE(getJointLimits(urdf_joint_bad, limits));
}
Expand All @@ -69,7 +68,7 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
urdf_joint->type = urdf::Joint::CONTINUOUS;

JointLimits limits;
joint_limits::JointLimits limits;
EXPECT_TRUE(getJointLimits(urdf_joint, limits));

// Position
Expand All @@ -92,7 +91,7 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
urdf_joint->type = urdf::Joint::REVOLUTE;

JointLimits limits;
joint_limits::JointLimits limits;
EXPECT_TRUE(getJointLimits(urdf_joint, limits));

// Position
Expand All @@ -117,7 +116,7 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
urdf_joint->type = urdf::Joint::PRISMATIC;

JointLimits limits;
joint_limits::JointLimits limits;
EXPECT_TRUE(getJointLimits(urdf_joint, limits));

// Position
Expand All @@ -141,25 +140,23 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)

TEST_F(JointLimitsUrdfTest, GetSoftJointLimits)
{
using namespace joint_limits;

// Unset URDF joint
{
SoftJointLimits soft_limits;
joint_limits::SoftJointLimits soft_limits;
urdf::JointSharedPtr urdf_joint_bad;
EXPECT_FALSE(getSoftJointLimits(urdf_joint_bad, soft_limits));
}

// Unset URDF limits
{
SoftJointLimits soft_limits;
joint_limits::SoftJointLimits soft_limits;
urdf::JointSharedPtr urdf_joint_bad(new urdf::Joint);
EXPECT_FALSE(getSoftJointLimits(urdf_joint_bad, soft_limits));
}

// Valid URDF joint
{
SoftJointLimits soft_limits;
joint_limits::SoftJointLimits soft_limits;
EXPECT_TRUE(getSoftJointLimits(urdf_joint, soft_limits));

// Soft limits
Expand Down
Loading