NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
eps_driver_tool.cc File Reference
#include <ff_common/init.h>
#include <gflags/gflags.h>
#include <gflags/gflags_completions.h>
#include <eps_driver/eps_driver.h>
#include <algorithm>
#include <cerrno>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
Include dependency graph for eps_driver_tool.cc:

Typedefs

typedef std::vector< std::string > Keywords
 
typedef std::pair< std::string, KeywordsValue
 
typedef std::map< uint32_t, ValueValueMap
 
using EPS = eps_driver::EPS
 

Functions

 DEFINE_string (device, "/dev/i2c-1", "i2c bus of EPS")
 
 DEFINE_int32 (address, 0x40, "i2c address of EPS")
 
 DEFINE_int32 (retries, 3, "i2c retries")
 
 DEFINE_string (w, "", "Write power state to given file")
 
 DEFINE_bool (reboot, false, "Reboot")
 
 DEFINE_bool (bootloader, false, "Jump to bootloader")
 
 DEFINE_bool (undock, false, "Send an undock command")
 
 DEFINE_bool (unterminate, false, "Clear a terminate event")
 
 DEFINE_bool (buzz, false, "Ring the buzzer")
 
 DEFINE_bool (hk, false, "View housekeeping information")
 
 DEFINE_bool (string, false, "View string information")
 
 DEFINE_bool (battery, false, "View battery information")
 
 DEFINE_bool (temp, false, "View temperatures")
 
 DEFINE_bool (fault, false, "View and clear faults")
 
 DEFINE_bool (power, false, "View and toggle power channels")
 
 DEFINE_bool (charge, false, "View and toggle charge state")
 
 DEFINE_bool (led, false, "View and configure LEDs")
 
 DEFINE_bool (state, false, "View state information")
 
 DEFINE_int32 (freq, 1000, "Buzzer frequency in Hz (1000 - 2000)")
 
 DEFINE_string (set, "", "Set a new value for all specified indexes")
 
 DEFINE_bool (get, false, "Get the current value for all specified indexes")
 
 DEFINE_bool (list, false, "List all indexes and keys for the given command")
 
 DEFINE_bool (clear, false, "Send a clear command (only for -fault)")
 
int Error (std::string const &msg, int code=-1)
 
int Print (std::string const &msg)
 
int Print (std::string const &title, ValueMap const &values, bool ro=false)
 
int HelpView (std::string const &flag, std::string const &desc, bool i=true)
 
int HelpConf (std::string const &flag, std::string const &desc, bool i=true)
 
int HelpBuzz (std::string const &flag, std::string const &desc)
 
int Help ()
 
bool Mask (ValueMap const &values, std::vector< std::string > const &idxs, uint32_t &mask, bool allow_all_to_be_selected=true)
 
bool Valid (ValueMap const &values, std::string const &input, uint32_t &val)
 
void Sleep (uint32_t microseconds)
 
int main (int argc, char **argv)
 

Typedef Documentation

◆ EPS

◆ Keywords

typedef std::vector<std::string> Keywords

◆ Value

typedef std::pair<std::string, Keywords> Value

◆ ValueMap

typedef std::map<uint32_t, Value> ValueMap

Function Documentation

◆ DEFINE_bool() [1/17]

DEFINE_bool ( battery  ,
false  ,
"View battery information"   
)

◆ DEFINE_bool() [2/17]

DEFINE_bool ( bootloader  ,
false  ,
"Jump to bootloader"   
)

◆ DEFINE_bool() [3/17]

DEFINE_bool ( buzz  ,
false  ,
"Ring the buzzer"   
)

◆ DEFINE_bool() [4/17]

DEFINE_bool ( charge  ,
false  ,
"View and toggle charge state  
)

◆ DEFINE_bool() [5/17]

DEFINE_bool ( clear  ,
false  ,
"Send a clear command (only for -fault)"   
)

◆ DEFINE_bool() [6/17]

DEFINE_bool ( fault  ,
false  ,
"View and clear faults  
)

◆ DEFINE_bool() [7/17]

DEFINE_bool ( get  ,
false  ,
"Get the current value for all specified indexes"   
)

◆ DEFINE_bool() [8/17]

DEFINE_bool ( hk  ,
false  ,
"View housekeeping information"   
)

◆ DEFINE_bool() [9/17]

DEFINE_bool ( led  ,
false  ,
"View and configure LEDs"   
)

◆ DEFINE_bool() [10/17]

DEFINE_bool ( list  ,
false  ,
"List all indexes and keys for the given command"   
)

◆ DEFINE_bool() [11/17]

DEFINE_bool ( power  ,
false  ,
"View and toggle power channels"   
)

◆ DEFINE_bool() [12/17]

DEFINE_bool ( reboot  ,
false  ,
"Reboot"   
)

◆ DEFINE_bool() [13/17]

DEFINE_bool ( state  ,
false  ,
"View state information"   
)

◆ DEFINE_bool() [14/17]

DEFINE_bool ( string  ,
false  ,
"View string information"   
)

◆ DEFINE_bool() [15/17]

DEFINE_bool ( temp  ,
false  ,
"View temperatures"   
)

◆ DEFINE_bool() [16/17]

DEFINE_bool ( undock  ,
false  ,
"Send an undock command"   
)

◆ DEFINE_bool() [17/17]

DEFINE_bool ( unterminate  ,
false  ,
"Clear a terminate event"   
)

◆ DEFINE_int32() [1/3]

DEFINE_int32 ( address  ,
0x40  ,
"i2c address of EPS  
)

◆ DEFINE_int32() [2/3]

DEFINE_int32 ( freq  ,
1000  ,
"Buzzer frequency in Hz (1000 - 2000)"   
)

◆ DEFINE_int32() [3/3]

DEFINE_int32 ( retries  ,
,
"i2c retries"   
)

◆ DEFINE_string() [1/3]

DEFINE_string ( device  ,
"/dev/i2c-1"  ,
"i2c bus of EPS  
)

◆ DEFINE_string() [2/3]

DEFINE_string ( set  ,
""  ,
"Set a new value for all specified indexes"   
)

◆ DEFINE_string() [3/3]

DEFINE_string ( ,
""  ,
"Write power state to given file"   
)

◆ Error()

int Error ( std::string const &  msg,
int  code = -1 
)

◆ Help()

int Help ( )

◆ HelpBuzz()

int HelpBuzz ( std::string const &  flag,
std::string const &  desc 
)

◆ HelpConf()

int HelpConf ( std::string const &  flag,
std::string const &  desc,
bool  i = true 
)

◆ HelpView()

int HelpView ( std::string const &  flag,
std::string const &  desc,
bool  i = true 
)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ Mask()

bool Mask ( ValueMap const &  values,
std::vector< std::string > const &  idxs,
uint32_t &  mask,
bool  allow_all_to_be_selected = true 
)

◆ Print() [1/2]

int Print ( std::string const &  msg)

◆ Print() [2/2]

int Print ( std::string const &  title,
ValueMap const &  values,
bool  ro = false 
)

◆ Sleep()

void Sleep ( uint32_t  microseconds)

◆ Valid()

bool Valid ( ValueMap const &  values,
std::string const &  input,
uint32_t &  val 
)