Hormodular 1.0
Locomotion gait discovery by using digital hormones on modular robots
Public Member Functions | Private Member Functions | Private Attributes
hormodular::SerialModularRobotInterface Class Reference

Interface to the modular robot via serial port. More...

#include <SerialModularRobotInterface.hpp>

Inheritance diagram for hormodular::SerialModularRobotInterface:
Inheritance graph
[legend]
Collaboration diagram for hormodular::SerialModularRobotInterface:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SerialModularRobotInterface (ConfigParser configParser)
virtual bool start ()
 Connects with the modular robot using the serial port.
virtual bool stop ()
 Stops the communication with the modular robot, closing the serial port.
virtual bool destroy ()
 Stops the communication with the modular robot, closing the serial port and frees all the dynamically allocated memory.
virtual bool reset ()
 Resets the communication with the modular robot, closing the serial port and connecting again to the robot.
virtual bool setProperty (std::string property, std::string value)
 Configure a property or parameter of the interface.
virtual float getTravelledDistance ()
 Returns the distance travelled my the modular robot in meters.
virtual bool sendJointValues (std::vector< float > joint_values, float step_ms=0)
 Sends the specified joint position values to the modular robot through the serial connection.
virtual std::vector< float > getJointValues ()
 Returns the joint position values stored in this class.

Private Member Functions

bool initSerialPort ()
 Configures and opens the serial port.
bool checkConnection ()
 Checks that the modular robot is connected by checking the initial message from the robot.
bool toggleLED ()
 Sends the commands required for toggling the user LED on the robot board.
bool sendJointValuesSerial (std::vector< float > joint_values)
 Sends the commands required for setting the joint position values on the modular robots.

Private Attributes

std::string port_name
SerialPort * serialPort
int step_ms
int num_modules
std::vector< float > joint_values

Detailed Description

Interface to the modular robot via serial port.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends