Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Classes | Functions | Variables
tesseract_common_serialization_unit.cpp File Reference

Tests serialization of types in tesseract_common. More...

#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/nvp.hpp>
#include <tesseract_common/eigen_serialization.h>
#include <tesseract_common/serialization.h>
#include <tesseract_common/unit_test_utils.h>
#include <tesseract_common/utils.h>
#include <tesseract_common/allowed_collision_matrix.h>
#include <tesseract_common/collision_margin_data.h>
#include <tesseract_common/atomic_serialization.h>
#include <tesseract_common/joint_state.h>
#include <tesseract_common/manipulator_info.h>
#include <tesseract_common/resource_locator.h>
Include dependency graph for tesseract_common_serialization_unit.cpp:

Classes

struct  ExtensionMacroTestA
 
struct  ExtensionMacroTestB
 

Functions

limits resize (3)
 
 EXPECT_EQ (limits.joint_limits.rows(), 3)
 
 EXPECT_EQ (limits.velocity_limits.rows(), 3)
 
 EXPECT_EQ (limits.acceleration_limits.rows(), 3)
 
limits joint_limits<< -5, 5, -5, 5, -5, 5;limits.velocity_limits=Eigen::VectorXd::Constant(3, 6);limits.acceleration_limits=Eigen::VectorXd::Constant(3, 7);tesseract_common::testSerialization< KinematicLimits > (limits, "KinematicLimits")
 
trajectory states push_back (joint_state)
 
object addAllowedCollision ("link_1", "link2", "reason1")
 
object addAllowedCollision ("link_2", "link1", "reason2")
 
object addAllowedCollision ("link_4", "link3", "reason3")
 
object addAllowedCollision ("link_5", "link2", "reason4")
 
object joints["test"] setIdentity ()
 
object joints["test"] translate (Eigen::Vector3d(2, 4, 8))
 
object setPairCollisionMargin ("link_1", "link2", 1.1)
 
object setPairCollisionMargin ("link_2", "link1", 2.2)
 
object setPairCollisionMargin ("link_4", "link3", 3.3)
 
object setPairCollisionMargin ("link_5", "link2", -4.4)
 
object search_paths insert ("path 1")
 
object search_paths insert ("path 2")
 
object search_libraries insert ("search_libraries 1")
 
object search_libraries insert ("search_libraries 2")
 
object search_libraries insert ("search_libraries 3")
 
 EXPECT_EQ (ext, "etax")
 
 EXPECT_EQ (default_ext, "trsx")
 
 EXPECT_EQ (ext, "etab")
 
 EXPECT_EQ (default_ext, "trsb")
 
int main (int argc, char **argv)
 

Variables

joint_state joint_names = { "joint_1", "joint_2", "joint_3" }
 
joint_state position = Eigen::VectorXd::Constant(3, 5)
 
joint_state velocity = Eigen::VectorXd::Constant(3, 6)
 
joint_state acceleration = Eigen::VectorXd::Constant(3, 7)
 
joint_state effort = Eigen::VectorXd::Constant(3, 8)
 
joint_state time = 100
 
JointTrajectory trajectory
 
trajectory description = "this is a test"
 
tesseract_common::testSerialization< AllowedCollisionMatrix > * object
 
PluginInfo plugin
 
plugin class_name = "test_class_name"
 
plugin config ["test"] = "value"
 
object discrete_plugin_infos default_plugin = "test_string"
 
object discrete_plugin_infos plugins ["plugin_key"] = plugin
 
object value = true
 
std::string default_ext = tesseract_common::serialization::xml::extension<ExtensionMacroTestB>::value
 

Detailed Description

Tests serialization of types in tesseract_common.

Author
Levi Armstrong
Matthew Powelson
Date
March 16, 2022
Version
TODO
Bug:
No known bugs
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ addAllowedCollision() [1/4]

object addAllowedCollision ( "link_1"  ,
"link2"  ,
"reason1"   
)

◆ addAllowedCollision() [2/4]

object addAllowedCollision ( "link_2"  ,
"link1"  ,
"reason2"   
)

◆ addAllowedCollision() [3/4]

object addAllowedCollision ( "link_4"  ,
"link3"  ,
"reason3"   
)

◆ addAllowedCollision() [4/4]

object addAllowedCollision ( "link_5"  ,
"link2"  ,
"reason4"   
)

◆ EXPECT_EQ() [1/7]

EXPECT_EQ ( default_ext  ,
"trsb"   
)

◆ EXPECT_EQ() [2/7]

EXPECT_EQ ( default_ext  ,
"trsx"   
)

◆ EXPECT_EQ() [3/7]

EXPECT_EQ ( ext  ,
"etab"   
)

◆ EXPECT_EQ() [4/7]

EXPECT_EQ ( ext  ,
"etax"   
)

◆ EXPECT_EQ() [5/7]

EXPECT_EQ ( limits.acceleration_limits.  rows(),
 
)

◆ EXPECT_EQ() [6/7]

EXPECT_EQ ( limits.joint_limits.  rows(),
 
)

◆ EXPECT_EQ() [7/7]

EXPECT_EQ ( limits.velocity_limits.  rows(),
 
)

◆ insert() [1/5]

object search_paths insert ( "path 1"  )
Initial value:
{
auto object = std::make_shared<TaskComposerPluginInfo>()

◆ insert() [2/5]

object search_paths insert ( "path 2"  )

◆ insert() [3/5]

object search_libraries insert ( "search_libraries 1"  )

◆ insert() [4/5]

object search_libraries insert ( "search_libraries 2"  )

◆ insert() [5/5]

object search_libraries insert ( "search_libraries 3"  )

◆ joint_limits<< -5, 5, -5, 5, -5, 5;limits.velocity_limits=Eigen::VectorXd::Constant(3, 6);limits.acceleration_limits=Eigen::VectorXd::Constant(3, 7);tesseract_common::testSerialization< KinematicLimits >()

limits joint_limits<< -5, 5, -5, 5, -5, 5;limits.velocity_limits=Eigen::VectorXd::Constant(3, 6);limits.acceleration_limits=Eigen::VectorXd::Constant(3, 7);tesseract_common::testSerialization< KinematicLimits > ( limits  ,
"KinematicLimits"   
)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ push_back()

trajectory states push_back ( joint_state  )

◆ resize()

limits resize ( )

◆ setIdentity()

pose setIdentity ( )
Initial value:
{
Eigen::Isometry3d pose
auto pose
Definition: tesseract_environment_collision.cpp:118

◆ setPairCollisionMargin() [1/4]

object setPairCollisionMargin ( "link_1"  ,
"link2"  ,
1.  1 
)

◆ setPairCollisionMargin() [2/4]

object setPairCollisionMargin ( "link_2"  ,
"link1"  ,
2.  2 
)

◆ setPairCollisionMargin() [3/4]

object setPairCollisionMargin ( "link_4"  ,
"link3"  ,
3.  3 
)

◆ setPairCollisionMargin() [4/4]

object setPairCollisionMargin ( "link_5"  ,
"link2"  ,
-4.  4 
)

◆ translate()

object joints["test"] translate ( Eigen::Vector3d(2, 4, 8)  )

Variable Documentation

◆ acceleration

joint_state acceleration = Eigen::VectorXd::Constant(3, 7)

◆ class_name

plugin class_name = "test_class_name"

◆ config

plugin config["test"] = "value"

◆ default_ext

◆ default_plugin

object default_plugin = "test_string"

◆ description

trajectory description = "this is a test"

◆ effort

joint_1 limits effort = Eigen::VectorXd::Constant(3, 8)

◆ joint_names

std::vector< std::string > joint_names = { "joint_1", "joint_2", "joint_3" }

◆ object

tesseract_common::testSerialization< SceneState > * object
Initial value:
{
auto object = std::make_shared<AllowedCollisionMatrix>()

◆ plugin

auto plugin
Initial value:

◆ plugins

object plugins = plugin

◆ position

joint_state position = Eigen::VectorXd::Constant(3, 5)

◆ time

joint_state time = 100

◆ trajectory

JointTrajectory trajectory

◆ value

object value = true

◆ velocity

joint_1 limits velocity = Eigen::VectorXd::Constant(3, 6)