Skip to content

Commit

Permalink
Backporting warning and linter fixes to iron (#55)
Browse files Browse the repository at this point in the history
* Change log message to STATUS (#54)

* Fix cpplint build/include_order errors (#53)

* Fix cpplint build/include_order errors

* Fix uncrustify parenthesis

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
  • Loading branch information
Blast545 authored Aug 20, 2024
1 parent 99df818 commit b68df3b
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ class RTIMicroDDSCommunicator : public Communicator
* \param data The data to publish.
*/
template<typename T>
static auto init_data(T & data)->decltype (data.header_.frame_id_, void ()) {
static auto init_data(T & data)->decltype (data.header_.frame_id_, void ())
{
data.header_.frame_id_ = DDS_String_dup("frame_id");
init_fields(data);
}
Expand All @@ -314,7 +315,8 @@ class RTIMicroDDSCommunicator : public Communicator
* \param data The data to publish.
*/
template<typename T>
static auto init_fields(T & data)->decltype (data.fields_, void ()) {
static auto init_fields(T & data)->decltype (data.fields_, void ())
{
auto fields_size = size(data.fields_);
for (uint8_t i = 0; i < fields_size; i++) {
data.fields_[i].name_ = DDS_String_dup("name");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#ifndef COMMUNICATION_ABSTRACTIONS__RESOURCE_MANAGER_HPP_
#define COMMUNICATION_ABSTRACTIONS__RESOURCE_MANAGER_HPP_

#include <cstdlib>
#include <memory>
#include <mutex>

#ifdef PERFORMANCE_TEST_FASTRTPS_ENABLED
#include <fastrtps/participant/Participant.h>
#include <fastrtps/attributes/ParticipantAttributes.h>
Expand Down Expand Up @@ -45,9 +49,6 @@
#endif

#include <rclcpp/rclcpp.hpp>
#include <cstdlib>
#include <memory>
#include <mutex>

#include "../experiment_configuration/experiment_configuration.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#ifndef COMMUNICATION_ABSTRACTIONS__ROS2_CALLBACK_COMMUNICATOR_HPP_
#define COMMUNICATION_ABSTRACTIONS__ROS2_CALLBACK_COMMUNICATOR_HPP_

#include <rclcpp/rclcpp.hpp>

#include <memory>
#include <atomic>

#include <rclcpp/rclcpp.hpp>

#include "../experiment_configuration/topics.hpp"

#include "ros2_communicator.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
#ifndef COMMUNICATION_ABSTRACTIONS__ROS2_COMMUNICATOR_HPP_
#define COMMUNICATION_ABSTRACTIONS__ROS2_COMMUNICATOR_HPP_


#include <rclcpp/rclcpp.hpp>

#include <memory>
#include <atomic>

#include <rclcpp/rclcpp.hpp>

#include "../experiment_configuration/topics.hpp"
#include "../experiment_configuration/qos_abstraction.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#ifndef COMMUNICATION_ABSTRACTIONS__ROS2_WAITSET_COMMUNICATOR_HPP_
#define COMMUNICATION_ABSTRACTIONS__ROS2_WAITSET_COMMUNICATOR_HPP_

#include <rclcpp/rclcpp.hpp>

#include <atomic>
#include <memory>
#include <mutex>
#include <thread>

#include <rclcpp/rclcpp.hpp>

#include "../experiment_configuration/topics.hpp"
#include "../experiment_configuration/qos_abstraction.hpp"

Expand Down
3 changes: 2 additions & 1 deletion performance_test/src/data_running/data_runner_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#ifndef DATA_RUNNING__DATA_RUNNER_BASE_HPP_
#define DATA_RUNNING__DATA_RUNNER_BASE_HPP_

#include <boost/core/noncopyable.hpp>
#include <string>

#include <boost/core/noncopyable.hpp>

#ifdef PERFORMANCE_TEST_MEMORYTOOLS_ENABLED
#include <osrf_testing_tools_cpp/memory_tools/memory_tools.hpp>
#include <osrf_testing_tools_cpp/scope_exit.hpp>
Expand Down
4 changes: 2 additions & 2 deletions performance_test/src/data_running/data_runner_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

#include "data_runner_factory.hpp"

#include <performance_test/for_each.hpp>

#include <string>
#include <memory>

#include <performance_test/for_each.hpp>

#ifdef PERFORMANCE_TEST_CALLBACK_EXECUTOR_ENABLED
#include "../communication_abstractions/ros2_callback_communicator.hpp"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

#include "experiment_configuration.hpp"

#include <boost/program_options.hpp>
#include <rmw/rmw.h>

#include <iostream>
#include <iomanip>
#include <exception>
#include <string>
#include <exception>
#include <iomanip>
#include <iostream>

#include <boost/program_options.hpp>

#include "topics.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#ifndef EXPERIMENT_CONFIGURATION__EXPERIMENT_CONFIGURATION_HPP_
#define EXPERIMENT_CONFIGURATION__EXPERIMENT_CONFIGURATION_HPP_

#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>

#include <string>
#include <fstream>
#include <vector>
#include <memory>
#include <chrono>

#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>


#include "qos_abstraction.hpp"
#include "communication_mean.hpp"
Expand All @@ -33,7 +35,6 @@
#ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED
#include <odb/core.hxx>
#endif
#include <chrono>

namespace performance_test
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
#ifndef EXPERIMENT_CONFIGURATION__EXTERNAL_INFO_STORAGE_HPP_
#define EXPERIMENT_CONFIGURATION__EXTERNAL_INFO_STORAGE_HPP_

#include <iostream>
#include <string>

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/exceptions.hpp>
#include <iostream>
#include <string>

#ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED
#include <odb/core.hxx>
Expand Down
7 changes: 4 additions & 3 deletions performance_test/src/experiment_execution/analyze_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <boost/algorithm/string.hpp>
#include <algorithm>
#include <cstdlib>
#include <cstddef>
#include <iostream>
#include <exception>
#include <memory>
#include <sstream>
#include <string>
#include <vector>

#include <boost/algorithm/string.hpp>

#include "analyze_runner.hpp"

#include "analysis_result.hpp"

#ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED
#include <odb/database.hxx>
#include <exception>
#include <memory>
#ifdef DATABASE_SQLITE
#include <odb/sqlite/database.hxx>
#endif
Expand Down
2 changes: 1 addition & 1 deletion performance_test/src/idlgen/fast_rtps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/objs/${RTIME_TARG

find_program(FASTRTPS_BIN "fastrtpsgen")
if(NOT FASTRTPS_BIN)
message(WARNING "Could not find program 'fastrtpsgen' in path. Trying to use bundled version")
message(STATUS "Could not find program 'fastrtpsgen' in path. Trying to use bundled version")
find_program(FASTRTPS_BIN "fastrtpsgen" PATHS "${PROJECT_SOURCE_DIR}/bin")
if(NOT FASTRTPS_BIN)
message(FATAL_ERROR "Could not find program 'fastrtpsgen'")
Expand Down
4 changes: 3 additions & 1 deletion performance_test/src/utilities/cpu_usage_tracker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
#ifndef UTILITIES__CPU_USAGE_TRACKER_HPP_
#define UTILITIES__CPU_USAGE_TRACKER_HPP_

#include <boost/timer/timer.hpp>
#include <thread>

#include <boost/timer/timer.hpp>


#if defined(QNX)
#include <sys/neutrino.h>
#include <sys/syspage.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef PERFORMANCE_TEST_ROS1_PUBLISHER_MSG_TYPES_HPP_INCLUDED
#define PERFORMANCE_TEST_ROS1_PUBLISHER_MSG_TYPES_HPP_INCLUDED

#include <boost/mpl/list.hpp>

#include <chrono>
#include <memory>

#include <boost/mpl/list.hpp>

#include "performance_test_ros1_msgs/Array16k.h"
#include "performance_test_ros1_msgs/Array1k.h"
#include "performance_test_ros1_msgs/Array1m.h"
Expand Down
4 changes: 3 additions & 1 deletion performance_test_ros1_publisher/src/publisher.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <memory>

#include "ros/ros.h"

#include "performance_test_ros1_publisher/msg_types.hpp"
Expand All @@ -6,7 +8,7 @@
#include <boost/mpl/for_each.hpp>
#include <boost/program_options.hpp>

#include <memory>


std::shared_ptr<MsgBase> msg_publisher_factory(ros::NodeHandle& nh, std::string topic_name)
{
Expand Down

0 comments on commit b68df3b

Please sign in to comment.