![]() |
Tesseract
Motion Planning Environment
|
#include <tesseract_common/macros.h>#include <gtest/gtest.h>#include <iostream>#include <fstream>#include <tesseract_geometry/geometries.h>#include <tesseract_common/utils.h>#include <tesseract_scene_graph/graph.h>
Variables | |
| TESSERACT_COMMON_IGNORE_WARNINGS_PUSH | TESSERACT_COMMON_IGNORE_WARNINGS_POP |
| JointDynamics | j |
| j | damping = 10 |
| j | friction = 5 |
| j | lower = 1 |
| j | upper = 2 |
| j | effort = 3 |
| j | velocity = 4 |
| j | acceleration = 5 |
| std::ostringstream | s |
| joint_1 | limits = std::make_shared<JointLimits>() |
| joint_1 | calibration = std::make_shared<JointCalibration>() |
| joint_1 calibration | rising = 0.1 |
| joint_1 calibration | falling = 0.1 |
| joint_1 | mimic = std::make_shared<JointMimic>() |
| joint_1 mimic | offset = 0.5 |
| joint_1 mimic | joint_name = "joint_0" |
| joint_1 mimic | multiplier = 1.5 |
| joint_1 | safety = std::make_shared<JointSafety>() |
| joint_1 safety | soft_lower_limit = -0.5 |
| joint_1 safety | soft_upper_limit = 0.5 |
| joint_1 safety | k_position = 1.1 |
| joint_1 safety | k_velocity = 2.5 |
| Joint | joint_1_clone = joint_1.clone() |
| std::ostringstream | s1 |
| j clear | ( | ) |
| EXPECT_EQ | ( | joint_1. | getName(), |
| "joint_n1" | |||
| ) |
| EXPECT_EQ | ( | joint_1_clone. | child_link_name, |
| "link_n2" | |||
| ) |
| EXPECT_EQ | ( | joint_1_clone. | getName(), |
| "joint_n1" | |||
| ) |
| EXPECT_EQ | ( | joint_1_clone.mimic-> | joint_name, |
| "joint_0" | |||
| ) |
| EXPECT_EQ | ( | joint_1_clone. | parent_link_name, |
| "link_n1" | |||
| ) |
| EXPECT_EQ | ( | joint_1_clone. | type, |
| JointType::PRISMATIC | |||
| ) |
| EXPECT_NEAR | ( | j. | damping, |
| 0 | , | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.calibration-> | rising, |
| 0. | 1, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.dynamics-> | damping, |
| 0. | 1, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.limits-> | effort, |
| 0. | 5, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.limits-> | lower, |
| - | 5, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.limits-> | upper, |
| 5 | , | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.limits-> | velocity, |
| 2 | , | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.mimic-> | multiplier, |
| 1. | 5, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.mimic-> | offset, |
| 0. | 5, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.safety-> | k_position, |
| 1. | 1, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.safety-> | k_velocity, |
| 2. | 5, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.safety-> | soft_lower_limit, |
| -0. | 5, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | joint_1_clone.safety-> | soft_upper_limit, |
| 0. | 5, | ||
| 1e- | 6 | ||
| ) |
| EXPECT_TRUE | ( | joint_1_clone.axis. | isApproxEigen::Vector3d::UnitZ() | ) |
| EXPECT_TRUE | ( | joint_1_clone.calibration ! | = joint_1.calibration | ) |
| EXPECT_TRUE | ( | joint_1_clone.dynamics ! | = joint_1.dynamics | ) |
| EXPECT_TRUE | ( | joint_1_clone.limits ! | = joint_1.limits | ) |
| EXPECT_TRUE | ( | joint_1_clone.mimic ! | = joint_1.mimic | ) |
| EXPECT_TRUE | ( | joint_1_clone.parent_to_joint_origin_transform. | isApproxjoint_1.parent_to_joint_origin_transform | ) |
| s<< j;EXPECT_FALSE(s.str().empty());} { using namespace tesseract_scene_graph;JointSafety j;EXPECT_NEAR(j.soft_upper_limit, 0, 1e-6);EXPECT_NEAR(j.soft_lower_limit, 0, 1e-6);EXPECT_NEAR(j.k_position, 0, 1e-6);EXPECT_NEAR(j.k_velocity, 0, 1e-6);j.soft_upper_limit=1;j.soft_lower_limit=2;j.k_position=3;j.k_velocity=4;j.clear();EXPECT_NEAR(j.soft_upper_limit, 0, 1e-6);EXPECT_NEAR(j.soft_lower_limit, 0, 1e-6);EXPECT_NEAR(j.k_position, 0, 1e-6);EXPECT_NEAR(j.k_velocity, 0, 1e-6);std::ostringstream s;s<< j;EXPECT_FALSE(s.str().empty());} { using namespace tesseract_scene_graph;JointCalibration j;EXPECT_NEAR(j.reference_position, 0, 1e-6);EXPECT_NEAR(j.rising, 0, 1e-6);EXPECT_NEAR(j.falling, 0, 1e-6);j.reference_position=1;j.rising=2;j.falling=3;j.clear();EXPECT_NEAR(j.reference_position, 0, 1e-6);EXPECT_NEAR(j.rising, 0, 1e-6);EXPECT_NEAR(j.falling, 0, 1e-6);std::ostringstream s;s<< j;EXPECT_FALSE(s.str().empty());} { using namespace tesseract_scene_graph;JointMimic j;EXPECT_NEAR(j.offset, 0, 1e-6);EXPECT_NEAR(j.multiplier, 1, 1e-6);EXPECT_TRUE(j.joint_name.empty());j.offset=1;j.multiplier=2;j.joint_name="joint_name";j.clear();EXPECT_NEAR(j.offset, 0, 1e-6);EXPECT_NEAR(j.multiplier, 1, 1e-6);EXPECT_TRUE(j.joint_name.empty());std::ostringstream s;s<< j;EXPECT_FALSE(s.str().empty());} { using namespace tesseract_scene_graph;Joint joint_1("joint_n1");EXPECT_TRUE(joint_1.parent_to_joint_origin_transform.isApprox(Eigen::Isometry3d::Identity()));EXPECT_TRUE(joint_1.child_link_name.empty());EXPECT_TRUE(joint_1.parent_link_name.empty());EXPECT_TRUE(joint_1.child_link_name.empty());EXPECT_TRUE(joint_1.dynamics==nullptr);EXPECT_TRUE(joint_1.limits==nullptr);EXPECT_TRUE(joint_1.safety==nullptr);EXPECT_TRUE(joint_1.calibration==nullptr);EXPECT_TRUE(joint_1.mimic==nullptr);EXPECT_TRUE(joint_1.type==JointType::UNKNOWN);joint_1.parent_to_joint_origin_transform.translation()=Eigen::Vector3d(1, 2, 3);joint_1.parent_link_name="link_n1";joint_1.child_link_name="link_n2";joint_1.axis=Eigen::Vector3d::UnitZ();joint_1.type=JointType::PRISMATIC;joint_1.dynamics=std::make_shared< JointDynamics > | ( | ) |
| j acceleration = 5 |
| joint_1 calibration = std::make_shared<JointCalibration>() |
| joint_1 calibration falling = 0.1 |
| JointLimits j |
| Joint joint_1_clone = joint_1.clone() |
| joint_7 limits = std::make_shared<JointLimits>() |
| joint_1 mimic = std::make_shared<JointMimic>() |
| joint_1 calibration rising = 0.1 |
| std::ostringstream s |
| std::ostringstream s1 |
| joint_1 safety = std::make_shared<JointSafety>() |
| TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP |