test_clientPOS.cpp
Go to the documentation of this file.
00001 #include "ros/ros.h"
00002 #include "std_msgs/String.h"
00003 #include <brics_actuator/JointPositions.h>              //brics
00004 #include <brics_actuator/JointVelocities.h>             //brics
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   //  ros::Publisher chatter_pub = n.advertise<brics_actuator::JointVelocities>("/cob_3d_mapping_demonstrator_controller/command_vel", 1);
00051 
00052   ros::Rate loop_rate(20);
00053 
00058   float count = 0;
00059 
00060   while (ros::ok())
00061   {
00065     brics_actuator::JointPositions jp;
00066  //   brics_actuator::JointVelocities jv;
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   //  chatter_pub.publish(jv);
00100 
00101     ros::spinOnce();
00102 
00103 //    loop_rate.sleep();
00104   }
00105   return 0;
00106 }


cob_3d_mapping_demonstrator
Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:03:46