4 #include <boost/assign/list_of.hpp> 6 #define polling_timeout_ 20 10 const uint8_t LEFT = 0, RIGHT = 1;
17 std::ostringstream ostream;
20 ostream << std::setfill(
'0') << std::uppercase;
21 for (
unsigned int i=0; i < data.
length; i++)
22 ostream << std::hex << std::setw(2) <<
static_cast<unsigned int>(data.
data[i]) <<
" " << std::dec;
24 std_msgs::StringPtr
msg(
new std_msgs::String);
25 msg->data = ostream.str();
26 ROS_INFO(
"reveive command:%s",msg->data.c_str());
33 double acc = (accel_left + accel_right)*0.5;
69 ROS_INFO(
"encoder[0].distance.x:%.2lf ,encoder[1].distance.x:%.2lf . ",enc->getTravel(LEFT),enc->getTravel(RIGHT));
74 ROS_ERROR(
"Could not get encoder data to calibrate travel offset");
80 ROS_INFO(
"encoder[0].clicks:%.2d ,encoder[1].clicks:%.2d . ",encoderraw->getTicks(LEFT),encoderraw->getTicks(RIGHT));
82 ROS_ERROR(
"Could not get encoder raw data to calibrate travel offset");
86 int main(
int argc,
char** argv){
88 std::string port =
"/dev/roch";
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
roch_driver::RawData getdata()
static Transport & instance()
void controloverallSpeed(double lin_vel, double ang_vel, double accel_left, double accel_right)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL void spin(Spinner &spinner)
ros::Subscriber speedSubscriber_
void connect(std::string port)
int main(int argc, char **argv)
unsigned char data[MAX_MSG_LENGTH]
void speedCallBack(const geometry_msgs::Twist::ConstPtr &speed)
#define ROS_ERROR_STREAM(args)
static Ptr requestData(double timeout)