Ejemplo n.º 1
0
 bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
 {
   buildBytes(Header::DockInfraRed, byteStream);
   buildBytes(length, byteStream);
   buildBytes(data.docking[0], byteStream);
   buildBytes(data.docking[1], byteStream);
   buildBytes(data.docking[2], byteStream);
   return true;
 }
Ejemplo n.º 2
0
 bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
 {
   buildBytes((unsigned char)Header::Cliff, byteStream);
   buildBytes(length, byteStream);
   buildBytes(data.bottom[0], byteStream);
   buildBytes(data.bottom[1], byteStream);
   buildBytes(data.bottom[2], byteStream);
   return true;
 }
Ejemplo n.º 3
0
 // methods
 bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
 {
   buildBytes(Header::UniqueDeviceID, byteStream);
   buildBytes(length, byteStream);
   buildBytes(data.udid0, byteStream);
   buildBytes(data.udid1, byteStream);
   buildBytes(data.udid2, byteStream);
   return true;
 }
Ejemplo n.º 4
0
 bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
 {
   buildBytes(Header::GpInput, byteStream);
   buildBytes(length, byteStream);
   buildBytes(data.digital_input, byteStream);
   for (unsigned int i = 0; i < data.analog_input.size(); ++i)
   {
     buildBytes(data.analog_input[i], byteStream);
   }
   for (unsigned int i = 0; i < 3; ++i)
   {
     buildBytes(0x0000, byteStream); //dummy
   }
   return true;
 }
Ejemplo n.º 5
0
  // methods
  bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
  {
    if (!(byteStream.size() > 0))
    {
      printf("kobuki_node: kobuki_udid: serialise failed. empty byte stream.");
      return false;
    }

    unsigned char length = 12;
    buildBytes(Header::UniqueDeviceID, byteStream);
    buildBytes(length, byteStream);
    buildBytes(data.udid0, byteStream);    
    buildBytes(data.udid1, byteStream);    
    buildBytes(data.udid2, byteStream);    
    return true;
  }
Ejemplo n.º 6
0
  bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
  {
    if (!(byteStream.size() > 0))
    {
      printf("kobuki_node: kobuki_cliff: serialise failed. empty byte stream.");
      return false;
    }

    unsigned char length = 6;
    buildBytes(Header::Cliff, byteStream);
    buildBytes(length, byteStream);
    buildBytes(data.bottom[0], byteStream);
    buildBytes(data.bottom[1], byteStream);
    buildBytes(data.bottom[2], byteStream);
    return true;
  }
Ejemplo n.º 7
0
  bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
  {
    if (!(byteStream.size() > 0))
    {
      //ROS_WARN_STREAM("kobuki_node: three_axis_gyro: serialise failed. empty byte stream.");
      return false;
    }

    unsigned char length = 2 + 2 * data.followed_data_length;
    buildBytes(Header::ThreeAxisGyro, byteStream);
    buildBytes(length, byteStream);
    buildBytes(data.frame_id, byteStream);
    buildBytes(data.followed_data_length, byteStream);
    for (unsigned int i=0; i<data.followed_data_length; i++)
      buildBytes(data.data[i], byteStream);
    return true;
  }
Ejemplo n.º 8
0
  bool serialise(ecl::PushAndPop<unsigned char> & byteStream)
  {
    if (!(byteStream.size() > 0))
    {
      //ROS_WARN_STREAM("kobuki_node: kobuki_inertia: serialise failed. empty byte stream.");
      return false;
    }

    unsigned char length = 7;
    buildBytes(Header::Inertia, byteStream);
    buildBytes(length, byteStream);
    buildBytes(data.angle, byteStream);
    buildBytes(data.angle_rate, byteStream);
    buildBytes(data.acc[0], byteStream);
    buildBytes(data.acc[1], byteStream);
    buildBytes(data.acc[2], byteStream);
    return true;
  }
Ejemplo n.º 9
0
bool CoreSensors::serialise(ecl::PushAndPop<unsigned char> & byteStream)
{
  if (!(byteStream.size() > 0))
  {
    //ROS_WARN_STREAM("kobuki_node: kobuki_default: serialise failed. empty byte stream.");
    return false;
  }
  unsigned char length = 15;
  buildBytes(Header::CoreSensors, byteStream);
  buildBytes(length, byteStream);
  buildBytes(data.time_stamp, byteStream);	//2
  buildBytes(data.bumper, byteStream);		//1
  buildBytes(data.wheel_drop, byteStream);	//1
  buildBytes(data.cliff, byteStream);		//1
  buildBytes(data.left_encoder, byteStream);	//2
  buildBytes(data.right_encoder, byteStream);	//2
  buildBytes(data.left_pwm, byteStream);	//1
  buildBytes(data.right_pwm, byteStream);	//1
  buildBytes(data.buttons, byteStream);		//1
  buildBytes(data.charger, byteStream);		//1
  buildBytes(data.battery, byteStream);		//1
  buildBytes(data.over_current, byteStream);	//1

  return true;
}
Ejemplo n.º 10
0
void VariableLengthInt::setValue(int value) {
	mValue = value;
	buildBytes();
}
void instantiate(int x) {
  buildBytes(x);
}