Skip to content
TomaszChrosniak edited this page Nov 6, 2014 · 3 revisions

Data flow

The correct data flow in a single move is presented on a sequence diagram below.

Sequence diagram

Moving the platform

In order to move the platform, the method movePlatform of the object Robot must be called, with a reference to the desired position of type Mat34. The object Robot has to call each of its Leg objects inverseKinematic method, which in turn compute the inverse kinematics for each servo. The returned data is then fed to the Board that controls the servos via the setPosition method. Most of the implementation is hidden on the lower levels. The code below demonstrates the uppermost level.

std::vector<float_type> destinationConfiguration = robot->movePlatform(destinationMatrix);
board->setPosition(destinationConfiguration);

Maintaining stability

In order for the platform to remain stable after finishing the moving procedure, the method computeCompliance of the object Robot must be called. The method in turn gets the required maximum torque needed to maintain the platforms current orientation even if external force is applied. The data is then fed to the servos via the Board::setTorqueLimit method.

std::vector<float_type> destinationCompliance = robot->computeCompliance(destinationConfiguration);
board->setTorqueLimit(destinationCompliance);

Clone this wiki locally