Tesseract 0.28.4
Loading...
Searching...
No Matches
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 <tesseract/common/serialization.h>
#include <tesseract/common/cereal_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/joint_state.h>
#include <tesseract/common/manipulator_info.h>
#include <tesseract/common/resource_locator.h>
#include <tesseract/common/kinematic_limits.h>
#include <tesseract/common/calibration_info.h>
#include <tesseract/common/plugin_info.h>
#include <tesseract/common/profile.h>
#include <tesseract/common/profile_dictionary.h>

Functions

bool tesseract::common::operator== (const ProfileDictionary &lhs, const ProfileDictionary &rhs)
 
bool tesseract::common::operator!= (const ProfileDictionary &lhs, const ProfileDictionary &rhs)
 
template<class Archive >
void tesseract::common::serialize (Archive &ar, TestProfile &obj)
 
 EXPECT_EQ (profile.getKey(), 100)
 
profile_dictionary addProfile ("test_namespace_1", "profile_a", profile_a)
 
profile_dictionary addProfile ("test_namespace_1", "profile_b", profile_b)
 
profile_dictionary addProfile ("test_namespace_2", "profile_c", profile_c)
 
profile_dictionary addProfile ("test_namespace_2", "profile_c", profile_d)
 
 tesseract::common::testSerialization< GeneralResourceLocator::Ptr > (locator, "GeneralResourceLocator", tesseract::common::testSerializationComparePtrEqual< GeneralResourceLocator::Ptr >)
 
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<< -6, 6, -6, 6, -6, 6;limits.acceleration_limits<< -7, 7, -7, 7, -7, 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 setCollisionMargin ("link_1", "link2", 1.1)
 
object setCollisionMargin ("link_2", "link1", 2.2)
 
object setCollisionMargin ("link_4", "link3", 3.3)
 
object setCollisionMargin ("link_5", "link2", -4.4)
 
object search_paths emplace_back ("path 1")
 
object search_paths emplace_back ("path 2")
 
object search_libraries emplace_back ("search_libraries 1")
 
object search_libraries emplace_back ("search_libraries 2")
 
object search_libraries emplace_back ("search_libraries 3")
 
 tesseract::common::testSerialization< Eigen::VectorXd > (ev, "eigen_vector_xd", compare_fn)
 
 for (int i=0;i< 5;++i)
 
 EXPECT_EQ (ext, ".etax")
 
 EXPECT_EQ (default_ext, ".trsx")
 
 EXPECT_EQ (ext, ".etaj")
 
 EXPECT_EQ (default_ext, ".trsj")
 
 EXPECT_EQ (ext, ".etab")
 
 EXPECT_EQ (default_ext, ".trsb")
 
int main (int argc, char **argv)
 

Variables

auto profile_b = std::make_shared<TestProfile>(100)
 
auto profile_c = std::make_shared<TestProfile>(200)
 
auto profile_d = std::make_shared<TestProfile>(200)
 
ProfileDictionary profile_dictionary
 
ManipulatorInfo manip_info2 ("manipulator", "world", "tool0")
 
manip_info2 tcp_offset = "tool0"
 
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 plugin_infos ["plugin 1"]["plugin_key"] = plugin
 
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
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

◆ setIdentity()

pose setIdentity ( )
Initial value:
{
Eigen::Isometry3d pose

◆ emplace_back()

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

Variable Documentation

◆ object

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

◆ plugin

auto plugin
Initial value:
{
Definition plugin_info.h:59