You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.8 KiB
80 lines
1.8 KiB
#ifndef _SVRDATA_H_
|
|
#define _SVRDATA_H_
|
|
|
|
#include <new>
|
|
#include <iostream>
|
|
#include <pthread.h>
|
|
|
|
#include "Singleton.h"
|
|
#include "friComm.h"
|
|
|
|
|
|
class SvrData: public Singleton
|
|
{
|
|
private:
|
|
struct {
|
|
float jointPos[LBR_MNJ];
|
|
float cartPos[FRI_CART_FRM_DIM];
|
|
float jacobian[FRI_CART_VEC * LBR_MNJ];
|
|
float forceAndTorque[FRI_CART_VEC];
|
|
} messured;
|
|
struct {
|
|
float jointPos[LBR_MNJ];
|
|
float cartPos[FRI_CART_FRM_DIM];
|
|
float pose[3][4]; //TODO what is this for
|
|
} commanded;
|
|
|
|
float velocity;
|
|
float accelaration;
|
|
|
|
struct {
|
|
struct {
|
|
float* velocity;
|
|
float* accelaration;
|
|
float* torque;
|
|
float* range;
|
|
} max;
|
|
unsigned int joints;
|
|
} robot;
|
|
|
|
pthread_mutex_t dataLock;
|
|
|
|
/// private constructor, because the database is a singleton
|
|
SvrData();
|
|
|
|
static bool instanceFlag;
|
|
static SvrData* single;
|
|
|
|
public:
|
|
~SvrData(void);
|
|
static SvrData* getInstance();
|
|
|
|
void lock();
|
|
void unlock();
|
|
|
|
int getMessuredJointPos(float* data, size_t size);
|
|
int getMessuredCartPos (float* data, size_t size);
|
|
int getMessuredJacobian(float* data, size_t size);
|
|
int getMessuredForceTorque(float* data, size_t size);
|
|
|
|
int getCommandedJointPos(float* data, size_t size);
|
|
int getCommandedCartPos (float* data, size_t size);
|
|
|
|
float getMaxTorque(unsigned int pos);
|
|
int getMaxTorque(float* data, size_t size);
|
|
|
|
float getMaxAccelaration(unsigned int pos);
|
|
int getMaxAccelaration(float* data, size_t size);
|
|
|
|
float getMaxRange(unsigned int pos);
|
|
int getMaxRange(float* data, size_t size);
|
|
|
|
unsigned int getJoints();
|
|
|
|
float getTrajectoryVelocity();
|
|
int setTrajectoryVelocity(float);
|
|
|
|
float getTrajectoryAccelaration();
|
|
float setTrajectoryAccelaration(float);
|
|
};
|
|
#endif
|