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.
basic_autonomy::log Namespace Reference

Functions

std::string basicPointToStream (lanelet::BasicPoint2d point)
 Helper function to convert a lanelet::BasicPoint2d to a string. More...
 
std::string pointSpeedPairToStream (waypoint_generation::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 RCLCPP_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 RCLCPP_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 RCLCPP_DEBUG_STREAM for each value in values where the printed value is << prefix << value. More...
 

Function Documentation

◆ basicPointToStream()

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

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

Definition at line 26 of file log.cpp.

27{
28 std::ostringstream out;
29 out << point.x() << ", " << point.y();
30 return out.str();
31}

References process_traj_logs::point.

Referenced by basic_autonomy::waypoint_generation::compose_lanefollow_trajectory_from_path(), and pointSpeedPairToStream().

Here is the caller graph for this function:

◆ pointSpeedPairToStream()

std::string basic_autonomy::log::pointSpeedPairToStream ( waypoint_generation::PointSpeedPair  point)

Helper function to convert a PointSpeedPair to a string.

Definition at line 35 of file log.cpp.

36{
37 std::ostringstream out;
38 out << "Point: " << basicPointToStream(point.point) << " Speed: " << point.speed;
39 return out.str();
40}
std::string basicPointToStream(lanelet::BasicPoint2d point)
Helper function to convert a lanelet::BasicPoint2d to a string.
Definition: log.cpp:26

References basicPointToStream(), and process_traj_logs::point.

Referenced by basic_autonomy::waypoint_generation::compose_lanefollow_trajectory_from_path().

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

◆ printDebugPerLine() [1/2]

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

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

Definition at line 40 of file log.hpp.

41 {
42 for (const auto& value : values)
43 {
44 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(BASIC_AUTONOMY_LOGGER), func(value));
45 }
46 }
static const std::string BASIC_AUTONOMY_LOGGER
Definition: log.hpp:22

References basic_autonomy::BASIC_AUTONOMY_LOGGER.

Referenced by basic_autonomy::waypoint_generation::compose_lanefollow_trajectory_from_path(), and printDebugPerLine().

Here is the caller graph for this function:

◆ printDebugPerLine() [2/2]

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

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

Definition at line 52 of file log.hpp.

53 {
54 auto function = static_cast<std::function<std::string(T)>>(free_func);
55 printDebugPerLine(values, function);
56 }
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 basic_autonomy::log::printDoublesPerLineWithPrefix ( const std::string &  prefix,
const std::vector< double > &  values 
)

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

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

Definition at line 45 of file log.cpp.

46{
47 for (const auto& value : values)
48 {
49 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(BASIC_AUTONOMY_LOGGER), prefix << value);
50 }
51}
static const std::string BASIC_AUTONOMY_LOGGER

References basic_autonomy::BASIC_AUTONOMY_LOGGER.

Referenced by basic_autonomy::waypoint_generation::compose_lanefollow_trajectory_from_path(), and basic_autonomy::waypoint_generation::optimize_speed().

Here is the caller graph for this function: