2 #include "sawyer_base/sawyer_hardware.h" 4 #include <boost/assign/list_of.hpp> 6 #define polling_timeout_ 20 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;
18 std_msgs::StringPtr
msg(
new std_msgs::String);
19 msg->data = ostream.str();
20 ROS_INFO(
"reveive command:%s",msg->data.c_str());
29 std::cout<<
"Received platform name:"<<getPlatformName->getName()<<std::endl;
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());
50 const uint8_t LEFT = 0, RIGHT = 1;
52 int main(
int argc,
char** argv){
54 std::string port =
"/dev/roch";
64 for (
int i = 0; i < 2; i++)
67 ROS_INFO(
"joints_[%d].distance.x:%.2lf ",i,enc->getTravel(i % 2));
72 ROS_ERROR(
"Could not get encoder data to calibrate travel offset");
roch_driver::RawData getdata()
static Transport & instance()
void connect(std::string port)
unsigned char data[MAX_MSG_LENGTH]
static Ptr requestData(double timeout)