Hormodular 1.0
Locomotion gait discovery by using digital hormones on modular robots
std::vector< float > hormodular::SimulatedModularRobotInterface::getJointValues ( ) [virtual]

Returns the actual joint position values of the simulated modular robot.

Implements hormodular::ModularRobotInterface.

{
    if (!controller)
    {
        std::cerr << "[SimModRobInterface][Error] Could not access the controller." << std::endl;
        return std::vector<float>();
    }

    //-- Send request to get the joint values:
    std::stringstream is, os;
    is << "getpos";
    controller->SendCommand(os,is);

    //-- Read the returned values:
    std::vector<float> joint_values;
    float aux;

    while( os.good() )
    {
        os >> aux;
        joint_values.push_back(aux);
    }

    return joint_values;
}
 All Classes Functions Variables Friends