2 #include <ros/console.h>
6 int main(
int argc,
char **argv)
8 double PUBLISH_FREQUENCY = 200.0;
10 double STEP_TIME = 0.2;
12 double APPLY_VELOCITY_DURATION = 1.0;
14 double SETPOINT_VELOCITY = 360.0*M_PI/180.0;
22 ros::Rate check_for_messages_rate(1);
24 ros::Rate send_command_rate(PUBLISH_FREQUENCY);
30 ROS_INFO(
"Waiting for state");
32 check_for_messages_rate.sleep();
39 ROS_INFO(
"Waiting for ready to proceed");
41 check_for_messages_rate.sleep();
45 for(
int i = 0; i < STEP_TIME*PUBLISH_FREQUENCY; i++)
52 send_command_rate.sleep();
56 for(
int i = 0; i < APPLY_VELOCITY_DURATION*PUBLISH_FREQUENCY; i++)
63 send_command_rate.sleep();
67 for (
int i = 0; i < 100; i++)
73 send_command_rate.sleep();
void checkForNewMessages()
bool initialStateReceived()
void setVelocityDirectly(double _joint_vel)
void initializeMotor(double _k_p_pos, double _k_d_pos, double _k_p_vel, double _k_i_vel, double _k_p_torque, double _k_i_torque)
int main(int argc, char **argv)