2 #include "sensor_msgs/JointState.h"
9 pub =
nh.advertise<sensor_msgs::JointState>(
"/motor/commands", 1);
17 tx_msg.position.push_back(0.0);
18 tx_msg.velocity.push_back(1.000);
19 tx_msg.effort.push_back(100.0);
23 void callback(
const sensor_msgs::JointState &rx_msg)
25 double recv_time = ros::Time::now().toSec();
29 ROS_INFO(
"Time [s]: %f\tTx: %f\tRx: %f\tErr: %f", duration,
tx_msg.position[0], rx_msg.position[0],
tx_msg.position[0] - rx_msg.position[0]);
51 int main(
int argc,
char **argv)
53 ros::init(argc, argv,
"master_node");
57 ros::Rate loop_rate(1000);
void callback(const sensor_msgs::JointState &_msg)
void callback(const sensor_msgs::JointState &rx_msg)
sensor_msgs::JointState tx_msg
int main(int argc, char **argv)