Tesseract 0.28.4
Loading...
Searching...
No Matches
tesseract_common_serialization_unit.cpp File Reference

Tests serialization of types in tesseract_common. More...

Classes

struct  NameIdTestAccess
 Test-only access to NameId internals; NameId declares this a friend. More...
struct  Serialization

Namespaces

namespace  tesseract::common
 Namespace owning boost's hash_is_avalanching, and defined iff boost has the trait at all.

Typedefs

using LinkIdPair

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 ("library 1")
object search_libraries emplace_back ("library 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")
 EXPECT_EQ (Serialization::toArchiveStringJSON(string_keyed, "lookup_table"), Serialization::toArchiveStringJSON(id_keyed, "lookup_table"))
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_ids = { "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
const auto [smaller, larger] = NameIdTestAccess::createReverseCanonical<LinkId>("link_a", "link_b")
const std::map< std::pair< std::string, std::string >, double > string_keyed
const std::unordered_map< LinkIdPair, double > id_keyed { { LinkIdPair(smaller, larger), 0.5 } }

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

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

◆ string_keyed

const std::map<std::pair<std::string, std::string>, double> string_keyed
Initial value:
{ { { smaller.name(), larger.name() },
0.5 } }