Mocks the joint_states interface. Can simulate robot movement by changing the position of the first joint in controller_joint_names
.
More...
#include <joint_state_publisher_mock.h>
Public Member Functions | |
JointStateConstPtr | getNextMessage () |
Return the message which will be published next. More... | |
void | goHome () |
Go back to home position (position=velocity=0.0). More... | |
JointStatePublisherMock () | |
JointStatePublisherMock (const JointStatePublisherMock &other)=delete | |
JointStatePublisherMock & | operator= (const JointStatePublisherMock &other)=delete |
void | setJoint1Velocity (const double &vel) |
void | startPublishingAsync (const double &joint1_start_position=0.0) |
void | stopPublishing () |
~JointStatePublisherMock () | |
Private Types | |
typedef sensor_msgs::JointState | JointState |
typedef sensor_msgs::JointStateConstPtr | JointStateConstPtr |
Private Member Functions | |
void | createNextMessage () |
void | publish () |
void | run () |
void | updateJoint1Position () |
void | updateNextMessage () |
Private Attributes | |
std::atomic_bool | go_home_flag_ |
double | joint1_position_ { 0.0 } |
double | joint1_velocity_ { 0.0 } |
std::vector< std::string > | joint_names_ |
JointState | next_msg_ |
std::mutex | next_msg_mutex_ |
ros::Time | next_time_stamp_ |
ros::NodeHandle | nh_ |
ros::Publisher | pub_ |
std::thread | publisher_thread_ |
std::atomic_bool | stop_flag_ |
Mocks the joint_states interface. Can simulate robot movement by changing the position of the first joint in controller_joint_names
.
Definition at line 38 of file joint_state_publisher_mock.h.
|
private |
Definition at line 40 of file joint_state_publisher_mock.h.
|
private |
Definition at line 41 of file joint_state_publisher_mock.h.
pilz_testutils::JointStatePublisherMock::JointStatePublisherMock | ( | ) |
Definition at line 37 of file joint_state_publisher_mock.cpp.
pilz_testutils::JointStatePublisherMock::~JointStatePublisherMock | ( | ) |
Definition at line 45 of file joint_state_publisher_mock.cpp.
|
delete |
|
private |
Definition at line 104 of file joint_state_publisher_mock.cpp.
sensor_msgs::JointStateConstPtr pilz_testutils::JointStatePublisherMock::getNextMessage | ( | ) |
Return the message which will be published next.
Definition at line 78 of file joint_state_publisher_mock.cpp.
void pilz_testutils::JointStatePublisherMock::goHome | ( | ) |
Go back to home position (position=velocity=0.0).
This is needed in order to ensure a clean tear-down. The current velocity is maintained until the home position is reached.
Definition at line 64 of file joint_state_publisher_mock.cpp.
|
delete |
|
private |
Definition at line 115 of file joint_state_publisher_mock.cpp.
|
private |
Definition at line 84 of file joint_state_publisher_mock.cpp.
void pilz_testutils::JointStatePublisherMock::setJoint1Velocity | ( | const double & | vel | ) |
Definition at line 57 of file joint_state_publisher_mock.cpp.
void pilz_testutils::JointStatePublisherMock::startPublishingAsync | ( | const double & | joint1_start_position = 0.0 | ) |
Definition at line 50 of file joint_state_publisher_mock.cpp.
void pilz_testutils::JointStatePublisherMock::stopPublishing | ( | ) |
Definition at line 69 of file joint_state_publisher_mock.cpp.
|
private |
Definition at line 126 of file joint_state_publisher_mock.cpp.
|
private |
Definition at line 120 of file joint_state_publisher_mock.cpp.
|
private |
Definition at line 82 of file joint_state_publisher_mock.h.
|
private |
Definition at line 84 of file joint_state_publisher_mock.h.
|
private |
Definition at line 85 of file joint_state_publisher_mock.h.
|
private |
Definition at line 80 of file joint_state_publisher_mock.h.
|
private |
Definition at line 87 of file joint_state_publisher_mock.h.
|
private |
Definition at line 88 of file joint_state_publisher_mock.h.
|
private |
Definition at line 86 of file joint_state_publisher_mock.h.
|
private |
Definition at line 78 of file joint_state_publisher_mock.h.
|
private |
Definition at line 79 of file joint_state_publisher_mock.h.
|
private |
Definition at line 83 of file joint_state_publisher_mock.h.
|
private |
Definition at line 81 of file joint_state_publisher_mock.h.