Fixposition SDK 0.0.0-heads/main-0-g90a51ff
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpsdk::ros1::utils Namespace Reference

ROS1 utilities. More...

Functions

void RedirectLoggingToRosConsole (const char *logger_name=ROSCONSOLE_DEFAULT_NAME)
 Redirect fp:common::logging to ROS console.
 
bool LoadRosParam (const std::string &name, int &value)
 Loads a parameter from the ROS parameter server (int)
 
bool LoadRosParam (const std::string &name, std::string &value)
 Loads a parameter from the ROS parameter server (string)
 
bool LoadRosParam (const std::string &name, bool &value)
 Loads a parameter from the ROS parameter server (bool)
 
bool LoadRosParam (const std::string &name, float &value)
 Loads a parameter from the ROS parameter server (float)
 
bool LoadRosParam (const std::string &name, double &value)
 Loads a parameter from the ROS parameter server (double)
 
bool LoadRosParam (const std::string &name, std::vector< std::string > &value)
 Loads a parameter from the ROS parameter server (list of strings)
 
ros::Time ConvTime (const fpsdk::common::time::Time &time)
 Convert to ROS time (atomic -> POSIX)
 
fpsdk::common::time::Time ConvTime (const ros::Time &time)
 Convert from ROS time (POSIX -> atomic)
 

Detailed Description

ROS1 utilities.

Function Documentation

◆ RedirectLoggingToRosConsole()

void fpsdk::ros1::utils::RedirectLoggingToRosConsole ( const char * logger_name = ROSCONSOLE_DEFAULT_NAME)

Redirect fp:common::logging to ROS console.

This configures the fpsdk::common::logging facility to output via the ROS console. This does not configure the ROS console (logger level, logger name, etc.).

The mapping of fpsdk::common::logging::LoggingLevel to ros::console::levels is as follows:

  • TRACE and DEBUG --> DEBUG
  • INFO and NOTICE --> INFO
  • WARNING --> WARN
  • ERROR --> ERROR
  • FATAL --> FATAL
Parameters
[in]logger_nameThe name of the logger. The default value should give the caller package's ROSCONSOLE_DEFAULT_NAME, for example, "ros1_fpsdk_demo". That is, typically this argument should be left empty (the default value).

◆ LoadRosParam() [1/6]

bool fpsdk::ros1::utils::LoadRosParam ( const std::string & name,
int & value )

Loads a parameter from the ROS parameter server (int)

Parameters
[in]nameThe parameter name
[out]valueThe value
Returns
true if parameter found and loaded, false otherwise

◆ LoadRosParam() [2/6]

bool fpsdk::ros1::utils::LoadRosParam ( const std::string & name,
std::string & value )

Loads a parameter from the ROS parameter server (string)

Parameters
[in]nameThe parameter name
[out]valueThe value
Returns
true if parameter found and loaded, false otherwise

◆ LoadRosParam() [3/6]

bool fpsdk::ros1::utils::LoadRosParam ( const std::string & name,
bool & value )

Loads a parameter from the ROS parameter server (bool)

Parameters
[in]nameThe parameter name
[out]valueThe value
Returns
true if parameter found and loaded, false otherwise

◆ LoadRosParam() [4/6]

bool fpsdk::ros1::utils::LoadRosParam ( const std::string & name,
float & value )

Loads a parameter from the ROS parameter server (float)

Parameters
[in]nameThe parameter name
[out]valueThe value
Returns
true if parameter found and loaded, false otherwise

◆ LoadRosParam() [5/6]

bool fpsdk::ros1::utils::LoadRosParam ( const std::string & name,
double & value )

Loads a parameter from the ROS parameter server (double)

Parameters
[in]nameThe parameter name
[out]valueThe value
Returns
true if parameter found and loaded, false otherwise

◆ LoadRosParam() [6/6]

bool fpsdk::ros1::utils::LoadRosParam ( const std::string & name,
std::vector< std::string > & value )

Loads a parameter from the ROS parameter server (list of strings)

Parameters
[in]nameThe parameter name
[out]valueThe value
Returns
true if parameter found and loaded, false otherwise

◆ ConvTime() [1/2]

ros::Time fpsdk::ros1::utils::ConvTime ( const fpsdk::common::time::Time & time)

Convert to ROS time (atomic -> POSIX)

Parameters
[in]timeThe Time object (atomic)
Returns
the ROS time object (POSIX)

◆ ConvTime() [2/2]

fpsdk::common::time::Time fpsdk::ros1::utils::ConvTime ( const ros::Time & time)

Convert from ROS time (POSIX -> atomic)

Parameters
[in]timeThe ROS time object (POSIX)
Returns
the Time object (atomic)