NASA Astrobee Robot Software  Astrobee Version:
Flight software for the Astrobee robots operating inside the International Space Station.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pmc_actuator_tool.cc File Reference
#include <pmc_actuator/pmc_actuator.h>
#include <unistd.h>
#include <cerrno>
#include <cstring>
#include <algorithm>
#include <chrono>
#include <fstream>
#include <iostream>
#include <iterator>
#include <map>
#include <mutex>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
Include dependency graph for pmc_actuator_tool.cc:

Classes

struct  PmcActuatorData
 

Macros

#define DEFAULT_CSV_FILE   "nozzle_identification.csv"
 
#define DEFAULT_I2C_DEV   "/dev/i2c-2"
 
#define DEFAULT_I2C_ADDRESSES   { 0x21, 0x20 }
 
#define DEFAULT_I2C_RETRIES   3
 
#define DEFAULT_CONTROL_RATE_HZ   62.5
 
#define MIN_BLOWER_SPEED   0
 
#define MAX_BLOWER_SPEED   232
 
#define MIN_NOZZLE_POSITION   0
 
#define MAX_NOZZLE_POSITION   255
 
#define STUB_CMDS_FILENAME   "/tmp/hw/pmc/commands"
 
#define STUB_TELEM_FILENAME   "/tmp/hw/pmc/telemetry"
 

Typedefs

typedef std::map< double, pmc_actuator::CommandPmcCommandList
 
typedef std::shared_ptr< pmc_actuator::PmcActuatorBasePmcActuatorPtr
 
typedef std::pair< PmcActuatorPtr, PmcActuatorDataPmcActuatorPair
 
typedef std::vector< PmcActuatorPairPmcActuatorVec
 

Functions

uint32_t InputUnsignedInteger (uint32_t min, uint32_t max)
 
std::string InputFile ()
 
void PmcMenu (PmcActuatorPair &pmc_pair)
 
bool RunFile (PmcActuatorVec &pmcs, std::string &csv)
 
bool MainMenu (PmcActuatorVec &pmcs, std::string &csv)
 
void ControlThread (PmcActuatorVec &pmcs, double rate, bool &finished)
 
int main (int argc, char *argv[])
 

Variables

bool kLogging = false
 
bool kDebug = false
 
bool kLooping = false
 
std::mutex data_mutex_
 
pmc_actuator::Command null_command_
 
std::chrono::time_point< std::chrono::steady_clock > plan_start_time_
 

Macro Definition Documentation

◆ DEFAULT_CONTROL_RATE_HZ

#define DEFAULT_CONTROL_RATE_HZ   62.5

◆ DEFAULT_CSV_FILE

#define DEFAULT_CSV_FILE   "nozzle_identification.csv"

◆ DEFAULT_I2C_ADDRESSES

#define DEFAULT_I2C_ADDRESSES   { 0x21, 0x20 }

◆ DEFAULT_I2C_DEV

#define DEFAULT_I2C_DEV   "/dev/i2c-2"

◆ DEFAULT_I2C_RETRIES

#define DEFAULT_I2C_RETRIES   3

◆ MAX_BLOWER_SPEED

#define MAX_BLOWER_SPEED   232

◆ MAX_NOZZLE_POSITION

#define MAX_NOZZLE_POSITION   255

◆ MIN_BLOWER_SPEED

#define MIN_BLOWER_SPEED   0

◆ MIN_NOZZLE_POSITION

#define MIN_NOZZLE_POSITION   0

◆ STUB_CMDS_FILENAME

#define STUB_CMDS_FILENAME   "/tmp/hw/pmc/commands"

◆ STUB_TELEM_FILENAME

#define STUB_TELEM_FILENAME   "/tmp/hw/pmc/telemetry"

Typedef Documentation

◆ PmcActuatorPair

◆ PmcActuatorPtr

◆ PmcActuatorVec

typedef std::vector<PmcActuatorPair> PmcActuatorVec

◆ PmcCommandList

typedef std::map<double, pmc_actuator::Command> PmcCommandList

Function Documentation

◆ ControlThread()

void ControlThread ( PmcActuatorVec pmcs,
double  rate,
bool &  finished 
)

◆ InputFile()

std::string InputFile ( )

◆ InputUnsignedInteger()

uint32_t InputUnsignedInteger ( uint32_t  min,
uint32_t  max 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ MainMenu()

bool MainMenu ( PmcActuatorVec pmcs,
std::string &  csv 
)

◆ PmcMenu()

void PmcMenu ( PmcActuatorPair pmc_pair)

◆ RunFile()

bool RunFile ( PmcActuatorVec pmcs,
std::string &  csv 
)

Variable Documentation

◆ data_mutex_

std::mutex data_mutex_

◆ kDebug

bool kDebug = false

◆ kLogging

bool kLogging = false

◆ kLooping

bool kLooping = false

◆ null_command_

pmc_actuator::Command null_command_

◆ plan_start_time_

std::chrono::time_point<std::chrono::steady_clock> plan_start_time_
Initial value:
=
std::chrono::steady_clock::now()