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.
log.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2022 LEIDOS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
18
19namespace basic_autonomy
20{
21namespace log
22{
26std::string basicPointToStream(lanelet::BasicPoint2d point)
27{
28 std::ostringstream out;
29 out << point.x() << ", " << point.y();
30 return out.str();
31}
36{
37 std::ostringstream out;
38 out << "Point: " << basicPointToStream(point.point) << " Speed: " << point.speed;
39 return out.str();
40}
41
45void printDoublesPerLineWithPrefix(const std::string& prefix, const std::vector<double>& values)
46{
47 for (const auto& value : values)
48 {
49 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(BASIC_AUTONOMY_LOGGER), prefix << value);
50 }
51}
52
53} // namespace log
54} // namespace basic_autonomy
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.
Definition: log.cpp:45
std::string basicPointToStream(lanelet::BasicPoint2d point)
Helper function to convert a lanelet::BasicPoint2d to a string.
Definition: log.cpp:26
std::string pointSpeedPairToStream(waypoint_generation::PointSpeedPair point)
Helper function to convert a PointSpeedPair to a string.
Definition: log.cpp:35
static const std::string BASIC_AUTONOMY_LOGGER
Definition: log.hpp:22