-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: joint limit for continous must be -inf, inf (#74)
* fix: joint limit for continous must be -inf, inf * fix: dont break pybing side
- Loading branch information
1 parent
994b03e
commit 6efef02
Showing
6 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "tinyfk.hpp" | ||
#include <gtest/gtest.h> | ||
|
||
using namespace tinyfk; | ||
|
||
TEST(TEST_PARSE, AllTest) { | ||
const std::string urdf_file = "../data/pr2.urdf"; | ||
const auto xml_string = load_urdf(urdf_file); | ||
auto kin = KinematicModel(xml_string); | ||
|
||
// continuous, revolute, prismatic | ||
auto ids = kin.get_joint_ids( | ||
{"r_forearm_roll_joint", "r_shoulder_pan_joint", "torso_lift_joint"}); | ||
auto pos_limits = kin.get_joint_position_limits(ids); | ||
|
||
// check that limit of r_forearm_roll_joint is continuous | ||
// <limit effort="30" velocity="3.6"/> | ||
EXPECT_EQ(pos_limits[0].first, -std::numeric_limits<double>::infinity()); | ||
EXPECT_EQ(pos_limits[0].second, std::numeric_limits<double>::infinity()); | ||
|
||
// check that limit of r_shoulder_pan_joint is | ||
// <limit effort="30" lower="-2.2853981634" upper="0.714601836603" | ||
// velocity="2.088"/> | ||
EXPECT_EQ(pos_limits[1].first, -2.2853981634); | ||
EXPECT_EQ(pos_limits[1].second, 0.714601836603); | ||
|
||
// check that limit of torso_lift_joint is | ||
// <limit effort="10000" lower="0.0" upper="0.33" velocity="0.013"/> | ||
EXPECT_EQ(pos_limits[2].first, 0.0); | ||
EXPECT_EQ(pos_limits[2].second, 0.33); | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |