Galaxis Codebase  1.0.0
Team Galaxis software stack for the Carolo Cup 2023 - ROS2 based software
marvelmind.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <pthread.h>
Include dependency graph for marvelmind.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PositionValue
 
struct  RawIMUValue
 
struct  FusionIMUValue
 
struct  RawDistanceItem
 
struct  RawDistances
 
struct  StationaryBeaconPosition
 
struct  StationaryBeaconsPositions
 
struct  MarvelmindHedge
 

Macros

#define DATA_INPUT_SEMAPHORE   "/mm_data_input_semaphore"
 
#define MAX_STATIONARY_BEACONS   30
 
#define MAX_BUFFERED_POSITIONS   3
 
#define POSITION_DATAGRAM_ID   0x0001
 
#define BEACONS_POSITIONS_DATAGRAM_ID   0x0002
 
#define POSITION_DATAGRAM_HIGHRES_ID   0x0011
 
#define BEACONS_POSITIONS_DATAGRAM_HIGHRES_ID   0x0012
 
#define IMU_RAW_DATAGRAM_ID   0x0003
 
#define BEACON_RAW_DISTANCE_DATAGRAM_ID   0x0004
 
#define IMU_FUSION_DATAGRAM_ID   0x0005
 
#define DEFAULT_TTY_FILENAME   "/dev/ttyACM0"
 

Functions

struct MarvelmindHedge * createMarvelmindHedge ()
 
void destroyMarvelmindHedge (struct MarvelmindHedge *hedge)
 
void startMarvelmindHedge (struct MarvelmindHedge *hedge)
 
void printPositionFromMarvelmindHedge (struct MarvelmindHedge *hedge, bool onlyNew)
 
bool getPositionFromMarvelmindHedge (struct MarvelmindHedge *hedge, struct PositionValue *position)
 
bool getStationaryBeaconsPositionsFromMarvelmindHedge (struct MarvelmindHedge *hedge, struct StationaryBeaconsPositions *positions)
 
void printStationaryBeaconsPositionsFromMarvelmindHedge (struct MarvelmindHedge *hedge, bool onlyNew)
 
bool getRawDistancesFromMarvelmindHedge (struct MarvelmindHedge *hedge, struct RawDistances *rawDistances)
 
void printRawDistancesFromMarvelmindHedge (struct MarvelmindHedge *hedge, bool onlyNew)
 
bool getRawIMUFromMarvelmindHedge (struct MarvelmindHedge *hedge, struct RawIMUValue *rawIMU)
 
void printRawIMUFromMarvelmindHedge (struct MarvelmindHedge *hedge, bool onlyNew)
 
bool getFusionIMUFromMarvelmindHedge (struct MarvelmindHedge *hedge, struct FusionIMUValue *fusionIMU)
 
void printFusionIMUFromMarvelmindHedge (struct MarvelmindHedge *hedge, bool onlyNew)
 
void stopMarvelmindHedge (struct MarvelmindHedge *hedge)
 

Macro Definition Documentation

◆ BEACON_RAW_DISTANCE_DATAGRAM_ID

#define BEACON_RAW_DISTANCE_DATAGRAM_ID   0x0004

Definition at line 142 of file marvelmind.h.

◆ BEACONS_POSITIONS_DATAGRAM_HIGHRES_ID

#define BEACONS_POSITIONS_DATAGRAM_HIGHRES_ID   0x0012

Definition at line 140 of file marvelmind.h.

◆ BEACONS_POSITIONS_DATAGRAM_ID

#define BEACONS_POSITIONS_DATAGRAM_ID   0x0002

Definition at line 138 of file marvelmind.h.

◆ DATA_INPUT_SEMAPHORE

#define DATA_INPUT_SEMAPHORE   "/mm_data_input_semaphore"

Definition at line 7 of file marvelmind.h.

◆ DEFAULT_TTY_FILENAME

#define DEFAULT_TTY_FILENAME   "/dev/ttyACM0"

Definition at line 179 of file marvelmind.h.

◆ IMU_FUSION_DATAGRAM_ID

#define IMU_FUSION_DATAGRAM_ID   0x0005

Definition at line 143 of file marvelmind.h.

◆ IMU_RAW_DATAGRAM_ID

#define IMU_RAW_DATAGRAM_ID   0x0003

Definition at line 141 of file marvelmind.h.

◆ MAX_BUFFERED_POSITIONS

#define MAX_BUFFERED_POSITIONS   3

Definition at line 88 of file marvelmind.h.

◆ MAX_STATIONARY_BEACONS

#define MAX_STATIONARY_BEACONS   30

Definition at line 80 of file marvelmind.h.

◆ POSITION_DATAGRAM_HIGHRES_ID

#define POSITION_DATAGRAM_HIGHRES_ID   0x0011

Definition at line 139 of file marvelmind.h.

◆ POSITION_DATAGRAM_ID

#define POSITION_DATAGRAM_ID   0x0001

Definition at line 137 of file marvelmind.h.

Function Documentation

◆ createMarvelmindHedge()

struct MarvelmindHedge* createMarvelmindHedge ( )

Definition at line 688 of file marvelmind.c.

688  {
689  struct MarvelmindHedge* hedge = malloc(sizeof(struct MarvelmindHedge));
690  if(hedge) {
692  hedge->baudRate = 9600;
693  hedge->positionBuffer = NULL;
694  hedge->verbose = false;
695  hedge->receiveDataCallback = NULL;
696  hedge->anyInputPacketCallback = NULL;
697  hedge->lastValuesCount_ = 0;
698  hedge->lastValues_next = 0;
699  hedge->haveNewValues_ = false;
700  hedge->terminationRequired = false;
701 
702  hedge->rawIMU.updated = false;
703  hedge->fusionIMU.updated = false;
704  hedge->rawDistances.updated = false;
705 #ifdef WIN32
706  InitializeCriticalSection(&hedge->lock_);
707 #else
708  pthread_mutex_init(&hedge->lock_, NULL);
709 #endif
710  } else
711  puts("Not enough memory");
712  return hedge;
713 }

References MarvelmindHedge::anyInputPacketCallback, MarvelmindHedge::baudRate, DEFAULT_TTY_FILENAME, MarvelmindHedge::fusionIMU, MarvelmindHedge::haveNewValues_, MarvelmindHedge::lastValues_next, MarvelmindHedge::lastValuesCount_, MarvelmindHedge::lock_, MarvelmindHedge::positionBuffer, MarvelmindHedge::rawDistances, MarvelmindHedge::rawIMU, MarvelmindHedge::receiveDataCallback, MarvelmindHedge::terminationRequired, MarvelmindHedge::ttyFileName, RawIMUValue::updated, FusionIMUValue::updated, RawDistances::updated, and MarvelmindHedge::verbose.

Referenced by MMNode::MMNode().

Here is the caller graph for this function:

◆ destroyMarvelmindHedge()

void destroyMarvelmindHedge ( struct MarvelmindHedge *  hedge)

Definition at line 1077 of file marvelmind.c.

1077  {
1078  if(hedge->positionBuffer)
1079  free(hedge->positionBuffer);
1080  free(hedge);
1081 }

References MarvelmindHedge::positionBuffer.

◆ getFusionIMUFromMarvelmindHedge()

bool getFusionIMUFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
struct FusionIMUValue *  fusionIMU 
)

Definition at line 1002 of file marvelmind.c.

1003  {
1004 #ifdef WIN32
1005  EnterCriticalSection(&hedge->lock_);
1006 #else
1007  pthread_mutex_lock(&hedge->lock_);
1008 #endif
1009 
1010  *fusionIMU = hedge->fusionIMU;
1011 
1012 #ifdef WIN32
1013  LeaveCriticalSection(&hedge->lock_);
1014 #else
1015  pthread_mutex_unlock(&hedge->lock_);
1016 #endif
1017 
1018  return true;
1019 }

References MarvelmindHedge::fusionIMU, and MarvelmindHedge::lock_.

Referenced by MMNode::on_mm_callback(), and printFusionIMUFromMarvelmindHedge().

Here is the caller graph for this function:

◆ getPositionFromMarvelmindHedge()

bool getPositionFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
struct PositionValue *  position 
)

Definition at line 816 of file marvelmind.c.

817  {
818  return getPositionFromMarvelmindHedgeByAddress(hedge, position, 0);
819 }

References getPositionFromMarvelmindHedgeByAddress().

Referenced by MMNode::on_mm_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRawDistancesFromMarvelmindHedge()

bool getRawDistancesFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
struct RawDistances *  rawDistances 
)

Definition at line 920 of file marvelmind.c.

921  {
922 #ifdef WIN32
923  EnterCriticalSection(&hedge->lock_);
924 #else
925  pthread_mutex_lock(&hedge->lock_);
926 #endif
927 
928  *rawDistances = hedge->rawDistances;
929 
930 #ifdef WIN32
931  LeaveCriticalSection(&hedge->lock_);
932 #else
933  pthread_mutex_unlock(&hedge->lock_);
934 #endif
935 
936  return true;
937 }

References MarvelmindHedge::lock_, and MarvelmindHedge::rawDistances.

Referenced by printRawDistancesFromMarvelmindHedge().

Here is the caller graph for this function:

◆ getRawIMUFromMarvelmindHedge()

bool getRawIMUFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
struct RawIMUValue *  rawIMU 
)

Definition at line 964 of file marvelmind.c.

965  {
966 #ifdef WIN32
967  EnterCriticalSection(&hedge->lock_);
968 #else
969  pthread_mutex_lock(&hedge->lock_);
970 #endif
971 
972  *rawIMU = hedge->rawIMU;
973 
974 #ifdef WIN32
975  LeaveCriticalSection(&hedge->lock_);
976 #else
977  pthread_mutex_unlock(&hedge->lock_);
978 #endif
979 
980  return true;
981 }

References MarvelmindHedge::lock_, and MarvelmindHedge::rawIMU.

Referenced by printRawIMUFromMarvelmindHedge().

Here is the caller graph for this function:

◆ getStationaryBeaconsPositionsFromMarvelmindHedge()

bool getStationaryBeaconsPositionsFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
struct StationaryBeaconsPositions *  positions 
)

Definition at line 869 of file marvelmind.c.

870  {
871 #ifdef WIN32
872  EnterCriticalSection(&hedge->lock_);
873 #else
874  pthread_mutex_lock(&hedge->lock_);
875 #endif
876 
877  *positions = hedge->positionsBeacons;
878 
879 #ifdef WIN32
880  LeaveCriticalSection(&hedge->lock_);
881 #else
882  pthread_mutex_unlock(&hedge->lock_);
883 #endif
884 
885  return true;
886 }

References MarvelmindHedge::lock_, and MarvelmindHedge::positionsBeacons.

Referenced by printStationaryBeaconsPositionsFromMarvelmindHedge().

Here is the caller graph for this function:

◆ printFusionIMUFromMarvelmindHedge()

void printFusionIMUFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
bool  onlyNew 
)

Definition at line 1021 of file marvelmind.c.

1022  {
1023  struct FusionIMUValue fusionIMU;
1024  float x_m, y_m, z_m;
1025  float qw, qx, qy, qz;
1026  float vx, vy, vz, ax, ay, az;
1027 
1028  getFusionIMUFromMarvelmindHedge(hedge, &fusionIMU);
1029 
1030  if(fusionIMU.updated || (!onlyNew)) {
1031  x_m = fusionIMU.x / 1000.0;
1032  y_m = fusionIMU.y / 1000.0;
1033  z_m = fusionIMU.z / 1000.0;
1034 
1035  qw = fusionIMU.qw / 10000.0;
1036  qx = fusionIMU.qx / 10000.0;
1037  qy = fusionIMU.qy / 10000.0;
1038  qz = fusionIMU.qz / 10000.0;
1039 
1040  vx = fusionIMU.vx / 1000.0;
1041  vy = fusionIMU.vy / 1000.0;
1042  vz = fusionIMU.vz / 1000.0;
1043 
1044  ax = fusionIMU.ax / 1000.0;
1045  ay = fusionIMU.ay / 1000.0;
1046  az = fusionIMU.az / 1000.0;
1047 
1048  printf("IMU fusion: Timestamp: %08d, X=%.3f Y= %.3f Z=%.3f q=%.3f,%.3f,%.3f,%.3f v=%.3f,%.3f,%.3f a=%.3f,%.3f,%.3f \n",
1049  (int)fusionIMU.timestamp,
1050  (float)x_m, (float)y_m, (float)z_m,
1051  (float)qw, (float)qx, (float)qy, (float)qz,
1052  (float)vx, (float)vy, (float)vz,
1053  (float)ax, (float)ay, (float)az);
1054 
1055  hedge->fusionIMU.updated = false;
1056  }
1057 }

References FusionIMUValue::ax, FusionIMUValue::ay, FusionIMUValue::az, MarvelmindHedge::fusionIMU, getFusionIMUFromMarvelmindHedge(), FusionIMUValue::qw, FusionIMUValue::qx, FusionIMUValue::qy, FusionIMUValue::qz, FusionIMUValue::timestamp, FusionIMUValue::updated, FusionIMUValue::vx, FusionIMUValue::vy, FusionIMUValue::vz, FusionIMUValue::x, FusionIMUValue::y, and FusionIMUValue::z.

Here is the call graph for this function:

◆ printPositionFromMarvelmindHedge()

void printPositionFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
bool  onlyNew 
)

Definition at line 825 of file marvelmind.c.

826  {
827  uint8_t i, j;
828  double xm, ym, zm;
829 
830  if(hedge->haveNewValues_ || (!onlyNew)) {
831  struct PositionValue position;
832  uint8_t addresses[MAX_BUFFERED_POSITIONS];
833  uint8_t addressesNum = 0;
834 
835  for(i = 0; i < MAX_BUFFERED_POSITIONS; i++) {
836  uint8_t address = hedge->positionBuffer[i].address;
837  bool alreadyProcessed = false;
838  if(addressesNum != 0)
839  for(j = 0; j < addressesNum; j++) {
840  if(address == addresses[j]) {
841  alreadyProcessed = true;
842  break;
843  }
844  }
845  if(alreadyProcessed)
846  continue;
847  addresses[addressesNum++] = address;
848 
850  xm = ((double)position.x) / 1000.0;
851  ym = ((double)position.y) / 1000.0;
852  zm = ((double)position.z) / 1000.0;
853  if(position.ready) {
854  if(position.highResolution) {
855  printf("Address: %d, X: %.3f, Y: %.3f, Z: %.3f, Angle: %.1f at time T: %u\n",
856  position.address, xm, ym, zm, position.angle, position.timestamp);
857  } else {
858  printf("Address: %d, X: %.2f, Y: %.2f, Z: %.2f, Angle: %.1f at time T: %u\n",
859  position.address, xm, ym, zm, position.angle, position.timestamp);
860  }
861  }
862  hedge->haveNewValues_ = false;
863  }
864  }
865 }

References PositionValue::address, PositionValue::angle, getPositionFromMarvelmindHedgeByAddress(), MarvelmindHedge::haveNewValues_, PositionValue::highResolution, MAX_BUFFERED_POSITIONS, MarvelmindHedge::positionBuffer, PositionValue::ready, PositionValue::timestamp, PositionValue::x, PositionValue::y, and PositionValue::z.

Here is the call graph for this function:

◆ printRawDistancesFromMarvelmindHedge()

void printRawDistancesFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
bool  onlyNew 
)

Definition at line 939 of file marvelmind.c.

940  {
941  struct RawDistances rawDistances;
942  uint8_t i;
943  float d_m;
944 
945  getRawDistancesFromMarvelmindHedge(hedge, &rawDistances);
946 
947  if(rawDistances.updated || (!onlyNew)) {
948  for(i = 0; i < 4; i++) {
949  if(rawDistances.distances[i].address_beacon != 0) {
950  d_m = rawDistances.distances[i].distance / 1000.0;
951  printf("Raw distance: %02d ==> %02d, Distance= %.3f \n",
952  (int)rawDistances.address_hedge,
953  (int)rawDistances.distances[i].address_beacon,
954  (float)d_m);
955  }
956  }
957 
958  hedge->rawDistances.updated = false;
959  }
960 }

References RawDistanceItem::address_beacon, RawDistances::address_hedge, RawDistanceItem::distance, RawDistances::distances, getRawDistancesFromMarvelmindHedge(), MarvelmindHedge::rawDistances, and RawDistances::updated.

Here is the call graph for this function:

◆ printRawIMUFromMarvelmindHedge()

void printRawIMUFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
bool  onlyNew 
)

Definition at line 983 of file marvelmind.c.

984  {
985  struct RawIMUValue rawIMU;
986 
987  getRawIMUFromMarvelmindHedge(hedge, &rawIMU);
988 
989  if(rawIMU.updated || (!onlyNew)) {
990  printf("Raw IMU: Timestamp: %08d, aX=%05d aY=%05d aZ=%05d gX=%05d gY=%05d gZ=%05d cX=%05d cY=%05d cZ=%05d \n",
991  (int)rawIMU.timestamp,
992  (int)rawIMU.acc_x, (int)rawIMU.acc_y, (int)rawIMU.acc_z,
993  (int)rawIMU.gyro_x, (int)rawIMU.gyro_y, (int)rawIMU.gyro_z,
994  (int)rawIMU.compass_x, (int)rawIMU.compass_y, (int)rawIMU.compass_z);
995 
996  hedge->rawIMU.updated = false;
997  }
998 }

References RawIMUValue::acc_x, RawIMUValue::acc_y, RawIMUValue::acc_z, RawIMUValue::compass_x, RawIMUValue::compass_y, RawIMUValue::compass_z, getRawIMUFromMarvelmindHedge(), RawIMUValue::gyro_x, RawIMUValue::gyro_y, RawIMUValue::gyro_z, MarvelmindHedge::rawIMU, RawIMUValue::timestamp, and RawIMUValue::updated.

Here is the call graph for this function:

◆ printStationaryBeaconsPositionsFromMarvelmindHedge()

void printStationaryBeaconsPositionsFromMarvelmindHedge ( struct MarvelmindHedge *  hedge,
bool  onlyNew 
)

Definition at line 888 of file marvelmind.c.

889  {
890  struct StationaryBeaconsPositions positions;
891  double xm, ym, zm;
892 
894 
895  if(positions.updated || (!onlyNew)) {
896  uint8_t i;
897  uint8_t n = hedge->positionsBeacons.numBeacons;
898  struct StationaryBeaconPosition* b;
899 
900  for(i = 0; i < n; i++) {
901  b = &positions.beacons[i];
902  xm = ((double)b->x) / 1000.0;
903  ym = ((double)b->y) / 1000.0;
904  zm = ((double)b->z) / 1000.0;
905  if(positions.beacons[i].highResolution) {
906  printf("Stationary beacon: address: %d, X: %.3f, Y: %.3f, Z: %.3f \n",
907  b->address, xm, ym, zm);
908  } else {
909  printf("Stationary beacon: address: %d, X: %.2f, Y: %.2f, Z: %.2f \n",
910  b->address, xm, ym, zm);
911  }
912  }
913 
914  hedge->positionsBeacons.updated = false;
915  }
916 }

References StationaryBeaconPosition::address, StationaryBeaconsPositions::beacons, getStationaryBeaconsPositionsFromMarvelmindHedge(), StationaryBeaconPosition::highResolution, StationaryBeaconsPositions::numBeacons, MarvelmindHedge::positionsBeacons, StationaryBeaconsPositions::updated, StationaryBeaconPosition::x, StationaryBeaconPosition::y, and StationaryBeaconPosition::z.

Referenced by MMNode::MMNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startMarvelmindHedge()

void startMarvelmindHedge ( struct MarvelmindHedge *  hedge)

Definition at line 718 of file marvelmind.c.

718  {
719  uint8_t i;
720 
721  hedge->positionBuffer =
722  malloc(sizeof(struct PositionValue) * MAX_BUFFERED_POSITIONS);
723  if(hedge->positionBuffer == NULL) {
724  if(hedge->verbose)
725  puts("Not enough memory");
726  hedge->terminationRequired = true;
727  return;
728  }
729  for(i = 0; i < MAX_BUFFERED_POSITIONS; i++) {
730  hedge->positionBuffer[i].ready = false;
731  hedge->positionBuffer[i].processed = false;
732  }
733  hedge->positionsBeacons.numBeacons = 0;
734  hedge->positionsBeacons.updated = false;
735 
736 #ifdef WIN32
737  _beginthread(Marvelmind_Thread_, 0, hedge);
738 #else
739  pthread_create(&hedge->thread_, NULL, Marvelmind_Thread_, hedge);
740 #endif
741 }

References Marvelmind_Thread_(), MAX_BUFFERED_POSITIONS, StationaryBeaconsPositions::numBeacons, MarvelmindHedge::positionBuffer, MarvelmindHedge::positionsBeacons, PositionValue::processed, PositionValue::ready, MarvelmindHedge::terminationRequired, MarvelmindHedge::thread_, StationaryBeaconsPositions::updated, and MarvelmindHedge::verbose.

Referenced by MMNode::MMNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopMarvelmindHedge()

void stopMarvelmindHedge ( struct MarvelmindHedge *  hedge)

Definition at line 1062 of file marvelmind.c.

1062  {
1063  hedge->terminationRequired = true;
1064  if(hedge->verbose)
1065  puts("stopping");
1066 #ifdef WIN32
1067  WaitForSingleObject(hedge->thread_, INFINITE);
1068 #else
1069  pthread_join(hedge->thread_, NULL);
1070 #endif
1071 }

References MarvelmindHedge::terminationRequired, MarvelmindHedge::thread_, and MarvelmindHedge::verbose.

StationaryBeaconPosition::x
int32_t x
Definition: marvelmind.h:76
MarvelmindHedge::positionsBeacons
struct StationaryBeaconsPositions positionsBeacons
Definition: marvelmind.h:103
RawIMUValue
Definition: marvelmind.h:22
MarvelmindHedge::anyInputPacketCallback
void(* anyInputPacketCallback)()
Definition: marvelmind.h:122
getFusionIMUFromMarvelmindHedge
bool getFusionIMUFromMarvelmindHedge(struct MarvelmindHedge *hedge, struct FusionIMUValue *fusionIMU)
Definition: marvelmind.c:1002
MarvelmindHedge::fusionIMU
struct FusionIMUValue fusionIMU
Definition: marvelmind.h:106
MarvelmindHedge::terminationRequired
bool terminationRequired
Definition: marvelmind.h:118
MarvelmindHedge::lastValuesCount_
uint8_t lastValuesCount_
Definition: marvelmind.h:125
FusionIMUValue::qx
int16_t qx
Definition: marvelmind.h:46
getPositionFromMarvelmindHedgeByAddress
static bool getPositionFromMarvelmindHedgeByAddress(struct MarvelmindHedge *hedge, struct PositionValue *position, uint8_t address)
Definition: marvelmind.c:749
getRawIMUFromMarvelmindHedge
bool getRawIMUFromMarvelmindHedge(struct MarvelmindHedge *hedge, struct RawIMUValue *rawIMU)
Definition: marvelmind.c:964
MarvelmindHedge::verbose
bool verbose
Definition: marvelmind.h:112
StationaryBeaconPosition::y
int32_t y
Definition: marvelmind.h:76
MarvelmindHedge
Definition: marvelmind.h:89
FusionIMUValue::qw
int16_t qw
Definition: marvelmind.h:45
FusionIMUValue::az
int16_t az
Definition: marvelmind.h:56
getStationaryBeaconsPositionsFromMarvelmindHedge
bool getStationaryBeaconsPositionsFromMarvelmindHedge(struct MarvelmindHedge *hedge, struct StationaryBeaconsPositions *positions)
Definition: marvelmind.c:869
MarvelmindHedge::thread_
pthread_t thread_
Definition: marvelmind.h:132
StationaryBeaconsPositions::updated
bool updated
Definition: marvelmind.h:85
FusionIMUValue::qy
int16_t qy
Definition: marvelmind.h:47
MarvelmindHedge::rawDistances
struct RawDistances rawDistances
Definition: marvelmind.h:108
MarvelmindHedge::baudRate
uint32_t baudRate
Definition: marvelmind.h:98
FusionIMUValue
Definition: marvelmind.h:40
PositionValue
Definition: marvelmind.h:9
FusionIMUValue::qz
int16_t qz
Definition: marvelmind.h:48
StationaryBeaconPosition
Definition: marvelmind.h:74
RawIMUValue::updated
bool updated
Definition: marvelmind.h:37
PositionValue::address
uint8_t address
Definition: marvelmind.h:10
getRawDistancesFromMarvelmindHedge
bool getRawDistancesFromMarvelmindHedge(struct MarvelmindHedge *hedge, struct RawDistances *rawDistances)
Definition: marvelmind.c:920
MarvelmindHedge::positionBuffer
struct PositionValue * positionBuffer
Definition: marvelmind.h:101
MarvelmindHedge::ttyFileName
const char * ttyFileName
Definition: marvelmind.h:94
RawDistances::updated
bool updated
Definition: marvelmind.h:71
MarvelmindHedge::haveNewValues_
bool haveNewValues_
Definition: marvelmind.h:127
PositionValue::processed
bool processed
Definition: marvelmind.h:19
MAX_BUFFERED_POSITIONS
#define MAX_BUFFERED_POSITIONS
Definition: marvelmind.h:88
DEFAULT_TTY_FILENAME
#define DEFAULT_TTY_FILENAME
Definition: marvelmind.h:179
FusionIMUValue::updated
bool updated
Definition: marvelmind.h:60
FusionIMUValue::vy
int16_t vy
Definition: marvelmind.h:51
RawDistances
Definition: marvelmind.h:67
StationaryBeaconsPositions
Definition: marvelmind.h:81
FusionIMUValue::ax
int16_t ax
Definition: marvelmind.h:54
FusionIMUValue::ay
int16_t ay
Definition: marvelmind.h:55
StationaryBeaconsPositions::numBeacons
uint8_t numBeacons
Definition: marvelmind.h:82
MarvelmindHedge::rawIMU
struct RawIMUValue rawIMU
Definition: marvelmind.h:105
StationaryBeaconPosition::z
int32_t z
Definition: marvelmind.h:76
MarvelmindHedge::lastValues_next
uint8_t lastValues_next
Definition: marvelmind.h:126
MarvelmindHedge::lock_
pthread_mutex_t lock_
Definition: marvelmind.h:133
FusionIMUValue::vz
int16_t vz
Definition: marvelmind.h:52
PositionValue::ready
bool ready
Definition: marvelmind.h:18
Marvelmind_Thread_
void * Marvelmind_Thread_(void *param)
Definition: marvelmind.c:497
StationaryBeaconPosition::address
uint8_t address
Definition: marvelmind.h:75
MarvelmindHedge::receiveDataCallback
void(* receiveDataCallback)(struct PositionValue position)
Definition: marvelmind.h:121
FusionIMUValue::vx
int16_t vx
Definition: marvelmind.h:50