test_platformInfo.cpp
Go to the documentation of this file.
1 #include <ros/ros.h>
2 #include "sawyer_base/sawyer_hardware.h"
3 
4 #include <boost/assign/list_of.hpp>
5 #include <float.h>
6 #define polling_timeout_ 20
7 using namespace std;
9 {
10 
11  std::ostringstream ostream;
13  ostream << "command: { " ;
14  ostream << std::setfill('0') << std::uppercase;
15  for (unsigned int i=0; i < data.length; i++)
16  ostream << std::hex << std::setw(2) << static_cast<unsigned int>(data.data[i]) << " " << std::dec;
17  ostream << "}";
18  std_msgs::StringPtr msg(new std_msgs::String);
19  msg->data = ostream.str();
20  ROS_INFO("reveive command:%s",msg->data.c_str());
21 }
22 
24 {
28  if(getPlatformName){
29  std::cout<<"Received platform name:"<<getPlatformName->getName()<<std::endl;
30 
31  }
32 }
33 
35 {
36 
40  if(getDifferentControlConstantData){
41  ROS_INFO("Received Data of Differential Control Data, Left_P:%.2lf, Left_I:%.2lf, Left_D:%.2lf,"
42  "right_P:%.2lf, right_I:%.2lf, right_D:%.2lf.",
43  getDifferentControlConstantData->getLeftP(),getDifferentControlConstantData->getLeftI(),getDifferentControlConstantData->getLeftD(),
44  getDifferentControlConstantData->getRightP(),getDifferentControlConstantData->getRightI(),getDifferentControlConstantData->getRightD());
45  }
46 
47  }
48 namespace
49 {
50  const uint8_t LEFT = 0, RIGHT = 1;
51 };
52 int main(int argc, char** argv){
53 
54  std::string port = "/dev/roch";
55  core::connect(port);
56  while(1){
57  ROS_INFO("begin send requestData");
59  20);
61 
62  if (enc)
63  {
64  for (int i = 0; i < 2; i++)//新本 双驱
65  {
66  //joints_[i].position_offset = linearToAngular(enc->getTravel(i % 2));
67  ROS_INFO("joints_[%d].distance.x:%.2lf ",i,enc->getTravel(i % 2));
68  }
69  }
70  else
71  {
72  ROS_ERROR("Could not get encoder data to calibrate travel offset");
73  }
74  }
75  return 0;
76 }
msg
roch_driver::RawData getdata()
Definition: Transport.h:103
static Transport & instance()
Definition: Transport.cpp:129
data
#define polling_timeout_
#define ROS_INFO(...)
int main(int argc, char **argv)
void connect(std::string port)
void getDifferentControlConstantData()
void getPlatformName()
unsigned char data[MAX_MSG_LENGTH]
Definition: serial.h:62
void publishRawData()
static Ptr requestData(double timeout)
Definition: core_wrapper.h:98
#define ROS_ERROR(...)


roch_base
Author(s): Mike Purvis , Paul Bovbel , Chen
autogenerated on Mon Jun 10 2019 14:41:14