Go to the documentation of this file. 1 #ifndef AIKIDO_CONTROL_ROS_ROSJOINTSTATECLIENT_HPP_
2 #define AIKIDO_CONTROL_ROS_ROSJOINTSTATECLIENT_HPP_
6 #include <boost/circular_buffer.hpp>
7 #include <dart/dynamics/dynamics.hpp>
8 #include <ros/callback_queue.h>
10 #include <sensor_msgs/JointState.h>
27 dart::dynamics::SkeletonPtr _skeleton,
28 ::ros::NodeHandle _nodeHandle,
29 const std::string& _topicName,
30 std::size_t _capacity);
39 const dart::dynamics::MetaSkeleton& _metaSkeleton)
const;
64 std::unordered_map<std::string, boost::circular_buffer<JointStateRecord>>
77 #endif // ifndef AIKIDO_CONTROL_ROS_ROSJOINTSTATECLIENT_HPP_
RosJointStateClient(dart::dynamics::SkeletonPtr _skeleton, ::ros::NodeHandle _nodeHandle, const std::string &_topicName, std::size_t _capacity)
Constructor.
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
dart::dynamics::SkeletonPtr mSkeleton
Definition: RosJointStateClient.hpp:63
Eigen::VectorXd getLatestPosition(const dart::dynamics::MetaSkeleton &_metaSkeleton) const
Returns the most recent position of each joint in _metaSkeleton.
std::size_t mCapacity
Definition: RosJointStateClient.hpp:66
::ros::Time mStamp
Definition: RosJointStateClient.hpp:53
void spin()
Update mBuffer with any JointState messages that have been received.
std::mutex mMutex
Definition: RosJointStateClient.hpp:61
::ros::CallbackQueue mCallbackQueue
Definition: RosJointStateClient.hpp:68
Client that listens for JointState messages for each skeleton joint and provides a method for extract...
Definition: RosJointStateClient.hpp:18
Definition: RosJointStateClient.hpp:46
bool isValid() const
Definition: RosJointStateClient.hpp:48
::ros::Subscriber mSubscriber
Definition: RosJointStateClient.hpp:70
double mPosition
Definition: RosJointStateClient.hpp:54
::ros::NodeHandle mNodeHandle
Definition: RosJointStateClient.hpp:69
std::unordered_map< std::string, boost::circular_buffer< JointStateRecord > > mBuffer
Definition: RosJointStateClient.hpp:65
void jointStateCallback(const sensor_msgs::JointState &_jointState)
Callback to add a new JointState to mBuffer.