Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
inlanecruising_plugin::log Namespace Reference

Functions

std::string basicPointToStream (lanelet::BasicPoint2d point)
 Helper function to convert a lanelet::BasicPoint2d to a string. More...
 
std::string pointSpeedPairToStream (PointSpeedPair point)
 Helper function to convert a PointSpeedPair to a string. More...
 
template<class T >
void printDebugPerLine (const std::vector< T > &values, std::function< std::string(T)> func)
 Print a RCLPP_DEBUG_STREAM for each value in values where the printed value is a string returned by func. More...
 
template<class T >
void printDebugPerLine (const std::vector< T > &values, std::string(*free_func)(T))
 Print a RCLPP_DEBUG_STREAM for each value in values where the printed value is a string returned by free_func. More...
 
void printDoublesPerLineWithPrefix (const std::string &prefix, const std::vector< double > &values)
 Print a RCLPP_DEBUG_STREAM for each value in values where the printed value is << prefix << value. More...
 

Function Documentation

◆ basicPointToStream()

std::string inlanecruising_plugin::log::basicPointToStream ( lanelet::BasicPoint2d  point)

Helper function to convert a lanelet::BasicPoint2d to a string.

Definition at line 11 of file log.hpp.

12{
13 std::ostringstream out;
14 out << point.x() << ", " << point.y();
15 return out.str();
16}

References process_traj_logs::point.

Referenced by pointSpeedPairToStream().

Here is the caller graph for this function:

◆ pointSpeedPairToStream()

std::string inlanecruising_plugin::log::pointSpeedPairToStream ( PointSpeedPair  point)

Helper function to convert a PointSpeedPair to a string.

Definition at line 20 of file log.hpp.

21{
22 std::ostringstream out;
23 out << "Point: " << basicPointToStream(point.point) << " Speed: " << point.speed;
24 return out.str();
25}
std::string basicPointToStream(lanelet::BasicPoint2d point)
Helper function to convert a lanelet::BasicPoint2d to a string.
Definition: log.hpp:11

References basicPointToStream(), and process_traj_logs::point.

Here is the call graph for this function:

◆ printDebugPerLine() [1/2]

template<class T >
void inlanecruising_plugin::log::printDebugPerLine ( const std::vector< T > &  values,
std::function< std::string(T)>  func 
)

Print a RCLPP_DEBUG_STREAM for each value in values where the printed value is a string returned by func.

Definition at line 31 of file log.hpp.

32{
33 for (const auto& value : values)
34 {
35 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(ILC_LOGGER), func(value));
36 }
37}
static const std::string ILC_LOGGER

References inlanecruising_plugin::ILC_LOGGER.

Referenced by printDebugPerLine().

Here is the caller graph for this function:

◆ printDebugPerLine() [2/2]

template<class T >
void inlanecruising_plugin::log::printDebugPerLine ( const std::vector< T > &  values,
std::string(*)(T)  free_func 
)

Print a RCLPP_DEBUG_STREAM for each value in values where the printed value is a string returned by free_func.

Definition at line 43 of file log.hpp.

44{
45 auto function = static_cast<std::function<std::string(T)>>(free_func);
46 printDebugPerLine(values, function);
47}
void printDebugPerLine(const std::vector< T > &values, std::string(*free_func)(T))
Print a RCLPP_DEBUG_STREAM for each value in values where the printed value is a string returned by f...
Definition: log.hpp:43

References printDebugPerLine().

Here is the call graph for this function:

◆ printDoublesPerLineWithPrefix()

void inlanecruising_plugin::log::printDoublesPerLineWithPrefix ( const std::string &  prefix,
const std::vector< double > &  values 
)

Print a RCLPP_DEBUG_STREAM for each value in values where the printed value is << prefix << value.

Definition at line 52 of file log.hpp.

53{
54 for (const auto& value : values)
55 {
56 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(ILC_LOGGER), prefix << value);
57 }
58}

References inlanecruising_plugin::ILC_LOGGER.