Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Functions | Variables
tesseract_scene_graph_joint_unit.cpp File Reference
#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>
Include dependency graph for tesseract_scene_graph_joint_unit.cpp:

Functions

 EXPECT_NEAR (j.damping, 0, 1e-6)
 
j clear ()
 
 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 > ()
 
 EXPECT_EQ (joint_1.getName(), "joint_n1")
 
 EXPECT_EQ (joint_1_clone.getName(), "joint_n1")
 
 EXPECT_EQ (joint_1_clone.parent_link_name, "link_n1")
 
 EXPECT_EQ (joint_1_clone.child_link_name, "link_n2")
 
 EXPECT_TRUE (joint_1_clone.parent_to_joint_origin_transform.isApprox(joint_1.parent_to_joint_origin_transform))
 
 EXPECT_TRUE (joint_1_clone.axis.isApprox(Eigen::Vector3d::UnitZ()))
 
 EXPECT_EQ (joint_1_clone.type, JointType::PRISMATIC)
 
 EXPECT_TRUE (joint_1_clone.dynamics !=joint_1.dynamics)
 
 EXPECT_NEAR (joint_1_clone.dynamics->damping, 0.1, 1e-6)
 
 EXPECT_TRUE (joint_1_clone.limits !=joint_1.limits)
 
 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->effort, 0.5, 1e-6)
 
 EXPECT_NEAR (joint_1_clone.limits->velocity, 2, 1e-6)
 
 EXPECT_TRUE (joint_1_clone.calibration !=joint_1.calibration)
 
 EXPECT_NEAR (joint_1_clone.calibration->rising, 0.1, 1e-6)
 
 EXPECT_TRUE (joint_1_clone.mimic !=joint_1.mimic)
 
 EXPECT_NEAR (joint_1_clone.mimic->offset, 0.5, 1e-6)
 
 EXPECT_EQ (joint_1_clone.mimic->joint_name, "joint_0")
 
 EXPECT_NEAR (joint_1_clone.mimic->multiplier, 1.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_NEAR (joint_1_clone.safety->k_position, 1.1, 1e-6)
 
 EXPECT_NEAR (joint_1_clone.safety->k_velocity, 2.5, 1e-6)
 

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
 

Function Documentation

◆ clear()

j clear ( )

◆ EXPECT_EQ() [1/6]

EXPECT_EQ ( joint_1.  getName(),
"joint_n1"   
)

◆ EXPECT_EQ() [2/6]

EXPECT_EQ ( joint_1_clone.  child_link_name,
"link_n2"   
)

◆ EXPECT_EQ() [3/6]

EXPECT_EQ ( joint_1_clone.  getName(),
"joint_n1"   
)

◆ EXPECT_EQ() [4/6]

EXPECT_EQ ( joint_1_clone.mimic->  joint_name,
"joint_0"   
)

◆ EXPECT_EQ() [5/6]

EXPECT_EQ ( joint_1_clone.  parent_link_name,
"link_n1"   
)

◆ EXPECT_EQ() [6/6]

EXPECT_EQ ( joint_1_clone.  type,
JointType::PRISMATIC   
)

◆ EXPECT_NEAR() [1/13]

EXPECT_NEAR ( j.  damping,
,
1e-  6 
)

◆ EXPECT_NEAR() [2/13]

EXPECT_NEAR ( joint_1_clone.calibration->  rising,
0.  1,
1e-  6 
)

◆ EXPECT_NEAR() [3/13]

EXPECT_NEAR ( joint_1_clone.dynamics->  damping,
0.  1,
1e-  6 
)

◆ EXPECT_NEAR() [4/13]

EXPECT_NEAR ( joint_1_clone.limits->  effort,
0.  5,
1e-  6 
)

◆ EXPECT_NEAR() [5/13]

EXPECT_NEAR ( joint_1_clone.limits->  lower,
5,
1e-  6 
)

◆ EXPECT_NEAR() [6/13]

EXPECT_NEAR ( joint_1_clone.limits->  upper,
,
1e-  6 
)

◆ EXPECT_NEAR() [7/13]

EXPECT_NEAR ( joint_1_clone.limits->  velocity,
,
1e-  6 
)

◆ EXPECT_NEAR() [8/13]

EXPECT_NEAR ( joint_1_clone.mimic->  multiplier,
1.  5,
1e-  6 
)

◆ EXPECT_NEAR() [9/13]

EXPECT_NEAR ( joint_1_clone.mimic->  offset,
0.  5,
1e-  6 
)

◆ EXPECT_NEAR() [10/13]

EXPECT_NEAR ( joint_1_clone.safety->  k_position,
1.  1,
1e-  6 
)

◆ EXPECT_NEAR() [11/13]

EXPECT_NEAR ( joint_1_clone.safety->  k_velocity,
2.  5,
1e-  6 
)

◆ EXPECT_NEAR() [12/13]

EXPECT_NEAR ( joint_1_clone.safety->  soft_lower_limit,
-0.  5,
1e-  6 
)

◆ EXPECT_NEAR() [13/13]

EXPECT_NEAR ( joint_1_clone.safety->  soft_upper_limit,
0.  5,
1e-  6 
)

◆ EXPECT_TRUE() [1/6]

EXPECT_TRUE ( joint_1_clone.axis.  isApproxEigen::Vector3d::UnitZ())

◆ EXPECT_TRUE() [2/6]

◆ EXPECT_TRUE() [3/6]

◆ EXPECT_TRUE() [4/6]

EXPECT_TRUE ( joint_1_clone.limits = joint_1.limits)

◆ EXPECT_TRUE() [5/6]

EXPECT_TRUE ( joint_1_clone.mimic = joint_1.mimic)

◆ EXPECT_TRUE() [6/6]

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 >()

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 > ( )

Variable Documentation

◆ acceleration

j acceleration = 5

◆ calibration

joint_1 calibration = std::make_shared<JointCalibration>()

◆ damping

joint_1 dynamics damping = 10

◆ effort

joint_1 limits effort = 3

◆ falling

joint_1 calibration falling = 0.1

◆ friction

joint_1 dynamics friction = 5

◆ j

JointLimits j
Initial value:
{
using namespace tesseract_scene_graph
Definition: graph.h:82

◆ joint_1_clone

Joint joint_1_clone = joint_1.clone()

◆ joint_name

joint_1 mimic joint_name = "joint_0"

◆ k_position

joint_1 safety k_position = 1.1

◆ k_velocity

joint_1 safety k_velocity = 2.5

◆ limits

joint_7 limits = std::make_shared<JointLimits>()

◆ lower

joint_1 limits lower = 1

◆ mimic

joint_1 mimic = std::make_shared<JointMimic>()

◆ multiplier

joint_1 mimic multiplier = 1.5

◆ offset

joint_1 mimic offset = 0.5

◆ rising

joint_1 calibration rising = 0.1

◆ s

std::ostringstream s

◆ s1

std::ostringstream s1

◆ safety

joint_1 safety = std::make_shared<JointSafety>()

◆ soft_lower_limit

joint_1 safety soft_lower_limit = -0.5

◆ soft_upper_limit

joint_1 safety soft_upper_limit = 0.5

◆ TESSERACT_COMMON_IGNORE_WARNINGS_POP

TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP
Initial value:
{
using namespace tesseract_scene_graph

◆ upper

joint_1 limits upper = 2

◆ velocity

joint_1 limits velocity = 4