Go to the documentation of this file.00001 #include "ros/ros.h"
00002 #include "std_msgs/String.h"
00003 #include <brics_actuator/JointPositions.h>
00004 #include <brics_actuator/JointVelocities.h>
00005
00006 #include <sstream>
00007
00011 int main(int argc, char **argv)
00012 {
00023 ros::init(argc, argv, "test_client");
00024
00030 ros::NodeHandle n;
00031
00049 ros::Publisher chatter_pub = n.advertise<brics_actuator::JointPositions>("/cob_3d_mapping_demonstrator_controller/command_pos", 1);
00050
00051
00052 ros::Rate loop_rate(20);
00053
00058 float count = 0;
00059
00060 while (ros::ok())
00061 {
00065 brics_actuator::JointPositions jp;
00066
00067 brics_actuator::JointValue jointVal;
00068 jointVal.timeStamp = ros::Time::now();
00069
00070 jointVal.joint_uri = "stepper";
00071 jointVal.unit = "rad";
00072 printf("Enter stepper target pos (rad): ");
00073 scanf("%f", &count);
00074 if(count == 9999)
00075 return 0;
00076
00077 jointVal.value = (double)count;
00078
00079 jp.positions.push_back(jointVal);
00080
00081 jointVal.joint_uri = "servo";
00082 jointVal.unit = "rad";
00083 printf("Enter servo target pos (rad): ");
00084 scanf("%f", &count);
00085 jointVal.value = (double)count;
00086
00087 jp.positions.push_back(jointVal);
00088
00089 chatter_pub.publish(jp);
00090
00091
00099
00100
00101 ros::spinOnce();
00102
00103
00104 }
00105 return 0;
00106 }