change_joint_acceleration_limits_command.cpp
Go to the documentation of this file.
1 
28 #include <boost/serialization/access.hpp>
29 #include <boost/serialization/nvp.hpp>
30 #if (BOOST_VERSION >= 107400) && (BOOST_VERSION < 107500)
31 #include <boost/serialization/library_version_type.hpp>
32 #endif
33 #include <boost/serialization/unordered_map.hpp>
34 #include <string>
36 
37 #include <tesseract_common/utils.h>
39 
40 namespace tesseract_environment
41 {
44 
46  : Command(CommandType::CHANGE_JOINT_ACCELERATION_LIMITS), limits_({ std::make_pair(std::move(joint_name), limit) })
47 {
48  assert(limit > 0);
49 }
50 
52  std::unordered_map<std::string, double> limits)
53  : Command(CommandType::CHANGE_JOINT_ACCELERATION_LIMITS), limits_(std::move(limits))
54 {
55  assert(std::all_of(limits_.begin(), limits_.end(), [](const auto& p) { return p.second > 0; }));
56 }
57 
58 const std::unordered_map<std::string, double>& ChangeJointAccelerationLimitsCommand::getLimits() const
59 {
60  return limits_;
61 }
62 
64 {
65  bool equal = true;
66  equal &= Command::operator==(rhs);
67  equal &= tesseract_common::isIdenticalMap<std::unordered_map<std::string, double>, double>(limits_, rhs.limits_);
68  return equal;
69 }
71 {
72  return !operator==(rhs);
73 }
74 
75 template <class Archive>
76 void ChangeJointAccelerationLimitsCommand::serialize(Archive& ar, const unsigned int /*version*/)
77 {
78  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Command);
79  ar& BOOST_SERIALIZATION_NVP(limits_);
80 }
81 } // namespace tesseract_environment
82 
tesseract_environment::ChangeJointAccelerationLimitsCommand::limits_
std::unordered_map< std::string, double > limits_
Definition: change_joint_acceleration_limits_command.h:73
tesseract_environment::ChangeJointAccelerationLimitsCommand::operator==
bool operator==(const ChangeJointAccelerationLimitsCommand &rhs) const
Definition: change_joint_acceleration_limits_command.cpp:63
tesseract_environment::ChangeJointAccelerationLimitsCommand::operator!=
bool operator!=(const ChangeJointAccelerationLimitsCommand &rhs) const
Definition: change_joint_acceleration_limits_command.cpp:70
tesseract_environment::Command::operator==
bool operator==(const Command &rhs) const
Definition: command.cpp:60
tesseract_environment
Definition: command.h:45
change_joint_acceleration_limits_command.h
Used to change a joints acceleration limits in environment.
tesseract_environment::CommandType::CHANGE_JOINT_ACCELERATION_LIMITS
@ CHANGE_JOINT_ACCELERATION_LIMITS
tesseract_environment::Command
Definition: command.h:83
utils.h
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_environment::ChangeJointAccelerationLimitsCommand::getLimits
const std::unordered_map< std::string, double > & getLimits() const
Definition: change_joint_acceleration_limits_command.cpp:58
serialization.h
TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_environment::ChangeJointAccelerationLimitsCommand
Definition: change_joint_acceleration_limits_command.h:46
tesseract_environment::ChangeJointAccelerationLimitsCommand::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: change_joint_acceleration_limits_command.cpp:76
macros.h
tesseract_environment::ChangeJointAccelerationLimitsCommand::ChangeJointAccelerationLimitsCommand
ChangeJointAccelerationLimitsCommand()
Definition: change_joint_acceleration_limits_command.cpp:42
tesseract_environment::CommandType
CommandType
Definition: command.h:47


tesseract_environment
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:21