change_joint_velocity_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_VELOCITY_LIMITS), limits_({ std::make_pair(std::move(joint_name), limit) })
47 {
48  assert(limit > 0);
49 }
50 
51 ChangeJointVelocityLimitsCommand::ChangeJointVelocityLimitsCommand(std::unordered_map<std::string, double> limits)
52  : Command(CommandType::CHANGE_JOINT_VELOCITY_LIMITS), limits_(std::move(limits))
53 {
54  assert(std::all_of(limits_.begin(), limits_.end(), [](const auto& p) { return p.second > 0; }));
55 }
56 
57 const std::unordered_map<std::string, double>& ChangeJointVelocityLimitsCommand::getLimits() const { return limits_; }
58 
60 {
61  bool equal = true;
62  equal &= Command::operator==(rhs);
63  equal &= tesseract_common::isIdenticalMap<std::unordered_map<std::string, double>, double>(limits_, rhs.limits_);
64  return equal;
65 }
67 {
68  return !operator==(rhs);
69 }
70 
71 template <class Archive>
72 void ChangeJointVelocityLimitsCommand::serialize(Archive& ar, const unsigned int /*version*/)
73 {
74  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Command);
75  ar& BOOST_SERIALIZATION_NVP(limits_);
76 }
77 } // namespace tesseract_environment
78 
tesseract_environment::Command::operator==
bool operator==(const Command &rhs) const
Definition: command.cpp:60
tesseract_environment
Definition: command.h:45
tesseract_environment::ChangeJointVelocityLimitsCommand::operator!=
bool operator!=(const ChangeJointVelocityLimitsCommand &rhs) const
Definition: change_joint_velocity_limits_command.cpp:66
tesseract_environment::CommandType::CHANGE_JOINT_VELOCITY_LIMITS
@ CHANGE_JOINT_VELOCITY_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
change_joint_velocity_limits_command.h
Used to change a joints velocity limits in environment.
serialization.h
TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_environment::ChangeJointVelocityLimitsCommand::getLimits
const std::unordered_map< std::string, double > & getLimits() const
Definition: change_joint_velocity_limits_command.cpp:57
tesseract_environment::ChangeJointVelocityLimitsCommand
Definition: change_joint_velocity_limits_command.h:46
tesseract_environment::ChangeJointVelocityLimitsCommand::ChangeJointVelocityLimitsCommand
ChangeJointVelocityLimitsCommand()
Definition: change_joint_velocity_limits_command.cpp:42
tesseract_environment::ChangeJointVelocityLimitsCommand::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: change_joint_velocity_limits_command.cpp:72
tesseract_environment::ChangeJointVelocityLimitsCommand::limits_
std::unordered_map< std::string, double > limits_
Definition: change_joint_velocity_limits_command.h:73
macros.h
tesseract_environment::CommandType
CommandType
Definition: command.h:47
tesseract_environment::ChangeJointVelocityLimitsCommand::operator==
bool operator==(const ChangeJointVelocityLimitsCommand &rhs) const
Definition: change_joint_velocity_limits_command.cpp:59


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