HeRoS: read out and log joint angles and force sensor data from the leg test bench.

Dependencies:   AS5048 LCM101 MODSERIAL PinDetect SDFileSystem mbed

Embed: (wiki syntax)

« Back to documentation index

Bench Class Reference

Bench Class Reference

Class to read out sensory information from the second test bench; the upper and lower leg, foot en toe setup with 1-dof hinges, each of which is equipped with an AMS AS5048 absolute rotary sensor. More...

#include <bench.h>

Public Member Functions

 Bench (PinName mosi, PinName miso, PinName sck, PinName cs, PinName p_lcm101)
 Create an object representing the testbench; the 4 AS5048 sensors with the offsets specified by the constants kOffsetsDegrees[4].
void Update ()
 Update routine for the testbench.
float getDegrees (Joint joint)
 Obtain the joint angle in degrees.
float getRadians (Joint joint)
 Obtain the joint angle in radians.

Detailed Description

Class to read out sensory information from the second test bench; the upper and lower leg, foot en toe setup with 1-dof hinges, each of which is equipped with an AMS AS5048 absolute rotary sensor.

The sensors are daisy chained and communicate via SPI

Definition at line 15 of file bench.h.


Constructor & Destructor Documentation

Bench ( PinName  mosi,
PinName  miso,
PinName  sck,
PinName  cs,
PinName  p_lcm101 
)

Create an object representing the testbench; the 4 AS5048 sensors with the offsets specified by the constants kOffsetsDegrees[4].

Parameters:
mosi,:mosi pin for sensor chain
miso,:miso pin for sensor chain
sck,:clock pin for sensor chain
cs,:chip select pin for sensor chain

Definition at line 11 of file bench.cpp.


Member Function Documentation

float getDegrees ( Joint  joint )

Obtain the joint angle in degrees.

These are the angles at the time of two Update() calls back

Parameters:
joint,:the joint for which the angle is requested
Returns:
: joint angle

Definition at line 49 of file bench.cpp.

float getRadians ( Joint  joint )

Obtain the joint angle in radians.

These are the angles at the time of two Update() calls back

Parameters:
joint,:the joint for which the angle is requested
Returns:
: joint angle

Definition at line 69 of file bench.cpp.

void Update (  )

Update routine for the testbench.

  • Updates the angle buffer of the sensor array
  • ... that's it for now (add filtering?) Note that angles lag one Update() behind, due to the way the SPI protocol works.

Definition at line 29 of file bench.cpp.