Esempio n. 1
0
 KinematicControl::
 KinematicControl (string const & name)
   : Process (name),
     kr_ (3.0),
     kd_ (-1.5),
     kg_ (8.0),
     vtrans_max_ (-1.0),
     vrot_max_ (-1.0),
     drive_ (0),
     enabled_ (true),
     have_goal_ (false)
 {
   // OK this is subtle and counter-intuitive.  If you set
   // sequence_mode (the 2nd arg) to false, then the yaml parses
   // fails with an invalid dereference.  What happens is that it
   // looks inside the sequence of 5 numbers that defines the goal,
   // and the first member of that sequence is a scalar, but the Goal
   // converter needs a vector.  I need to find a way to produce an
   // appropriate error message in this case.
   //
   reflectCallback<Goal> ("goal", false, boost::bind (&KinematicControl::setGoal, this, _1));
   reflectParameter ("kr", &kr_);
   reflectParameter ("kd", &kd_);
   reflectParameter ("kg", &kg_);
   reflectSlot ("drive", &drive_);
   reflectParameter ("vtrans_max", &vtrans_max_);
   reflectParameter ("vrot_max", &vrot_max_);
 }
 DifferentialTrailerDrive::
 DifferentialTrailerDrive (string const & name)
   : DifferentialDrive (name),
     hitch_offset_ (1.0),
     trailer_arm_ (1.0),
     trailer_ (0),
     trailer_angle_ (0.0)
 {
   reflectParameter ("hitch_offset", &hitch_offset_);
   reflectParameter ("trailer_arm", &trailer_arm_);
   reflectParameter ("trailer_angle", &trailer_angle_);
   reflectSlot ("trailer", &trailer_);
 }