initialisation.cpp
Go to the documentation of this file.
1 
6 /*****************************************************************************
7 ** Includes
8 *****************************************************************************/
9 
10 #include <iostream>
11 #include <kobuki_driver/kobuki.hpp>
12 #include <ecl/time.hpp>
13 
15 public:
17  kobuki::Parameters parameters;
18  // change the default device port from /dev/kobuki to /dev/ttyUSB0
19  parameters.device_port = "/dev/ttyUSB0";
20  // Other parameters are typically happy enough as defaults
21  // namespaces all sigslot connection names under this value, only important if you want to
22  parameters.sigslots_namespace = "/kobuki";
23  // Most people will prefer to do their own velocity smoothing/acceleration limiting.
24  // If you wish to utilise kobuki's minimal acceleration limiter, set to true
25  parameters.enable_acceleration_limiter = false;
26  // If your battery levels are showing significant variance from factory defaults, adjust thresholds.
27  // This will affect the led on the front of the robot as well as when signals are emitted by the driver.
28  parameters.battery_capacity = 16.5;
29  parameters.battery_low = 14.0;
30  parameters.battery_dangerous = 13.2;
31 
32  // initialise - it will throw an exception if parameter validation or initialisation fails.
33  try {
34  kobuki.init(parameters);
35  } catch ( ecl::StandardException &e ) {
36  std::cout << e.what();
37  }
38  }
39 private:
41 };
42 
43 int main() {
44  KobukiManager kobuki_manager;
45  ecl::Sleep()(5);
46  return 0;
47 }
double battery_low
Threshold for battery level warnings [14.0V].
Definition: parameters.hpp:59
KobukiManager()
Default constructor, needs initialisation.
std::string device_port
The serial device port name [/dev/kobuki].
Definition: parameters.hpp:54
double battery_dangerous
Threshold for battery level in danger of depletion [13.2V].
Definition: parameters.hpp:60
std::string sigslots_namespace
The first part of a sigslot connection namespace ["/kobuki"].
Definition: parameters.hpp:55
Device driver core interface.
kobuki::Kobuki kobuki
Parameter list and validator for the kobuki.
Definition: parameters.hpp:36
Keyboard remote control for our robot core (mobile base).
The core kobuki driver class.
Definition: kobuki.hpp:87
int main()
double battery_capacity
Capacity voltage of the battery [16.5V].
Definition: parameters.hpp:58
bool enable_acceleration_limiter
Enable or disable the acceleration limiter [true].
Definition: parameters.hpp:57


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Mon Mar 27 2017 01:02:59