2 #include <ros/console.h>
6 int main(
int argc,
char **argv)
8 bool USE_POSITION_CONTROL =
false;
10 double PUBLISH_FREQUENCY = 100.0;
12 double STEP_TIME = 0.2;
14 double APPLY_TORQUE_DURATION = 1.0;
16 double SETPOINT_TORQUE = 5.0;
24 ros::Rate check_for_messages_rate(1);
26 ros::Rate send_command_rate(PUBLISH_FREQUENCY);
32 ROS_INFO(
"Waiting for state");
34 check_for_messages_rate.sleep();
41 ROS_INFO(
"Waiting for ready to proceed");
43 check_for_messages_rate.sleep();
47 for(
int i = 0; i < STEP_TIME*PUBLISH_FREQUENCY; i++)
54 send_command_rate.sleep();
58 for(
int i = 0; i < APPLY_TORQUE_DURATION*PUBLISH_FREQUENCY; i++)
65 send_command_rate.sleep();
75 send_command_rate.sleep();
void checkForNewMessages()
bool initialStateReceived()
void setTorqueDirectly(double _torque)
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)