Skip to content

Commit

Permalink
Add linters and fix linter errors (autowarefoundation#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
jilaada authored Dec 17, 2020
1 parent 0e48a65 commit a31d78d
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 15 deletions.
7 changes: 7 additions & 0 deletions vehicle/as/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ament_auto_find_build_dependencies()

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-unused-parameter -Wall -Wextra -Wpedantic)
Expand All @@ -21,6 +23,11 @@ ament_auto_add_executable(pacmod_interface
src/pacmod_interface/pacmod_interface_node.cpp
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package(
INSTALL_TO_SHARE
launch
Expand Down
14 changes: 7 additions & 7 deletions vehicle/as/include/pacmod_interface/pacmod_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef VEHICLE_AS_PACMOD_INTERFACE_H
#define VEHICLE_AS_PACMOD_INTERFACE_H

#include "message_filters/subscriber.h"
#include "message_filters/sync_policies/approximate_time.h"
#include "message_filters/synchronizer.h"
#ifndef PACMOD_INTERFACE__PACMOD_INTERFACE_HPP_
#define PACMOD_INTERFACE__PACMOD_INTERFACE_HPP_

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <memory>
#include <string>

#include "message_filters/subscriber.h"
#include "message_filters/sync_policies/approximate_time.h"
#include "message_filters/synchronizer.h"

#include "geometry_msgs/msg/twist_stamped.hpp"
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/bool.hpp"
Expand Down Expand Up @@ -157,4 +157,4 @@ class PacmodInterface : public rclcpp::Node
int32_t toAutowareTurnSignal(const pacmod_msgs::msg::SystemRptInt & turn);
};

#endif
#endif // PACMOD_INTERFACE__PACMOD_INTERFACE_HPP_
12 changes: 6 additions & 6 deletions vehicle/as/include/ssc_interface/ssc_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SSC_INTERFACE_H
#define SSC_INTERFACE_H
#ifndef SSC_INTERFACE__SSC_INTERFACE_HPP_
#define SSC_INTERFACE__SSC_INTERFACE_HPP_

#include <memory>
#include <string>

#include "message_filters/subscriber.h"
#include "message_filters/sync_policies/approximate_time.h"
#include "message_filters/synchronizer.h"

#include <memory>
#include <string>

#include "rclcpp/rclcpp.hpp"

#include "builtin_interfaces/msg/time.hpp"
Expand Down Expand Up @@ -171,4 +171,4 @@ class SSCInterface : public rclcpp::Node
int32_t toAutowareTurnSignal(const pacmod_msgs::msg::SystemRptInt & turn) const;
};

#endif // SSC_INTERFACE_H
#endif // SSC_INTERFACE__SSC_INTERFACE_HPP_
6 changes: 5 additions & 1 deletion vehicle/as/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<version>0.1.0</version>
<description>AutonomouStuff vehicle interface as a ROS 2 node</description>
<maintainer email="aohsato@gmail.com">Akihito Ohsato</maintainer>
<license>Apache License 2.0</license>

<author email="aohsato@gmail.com">Akihito Ohsato</author>
<author email="antm678@ertl.jp">T.Ando</author>
<author email="horibe.takamasa@gmail.com">Horibe Takamasa</author>
<license>Apache License 2.0</license>

<depend>rclcpp</depend>
<depend>automotive_navigation_msgs</depend>
Expand All @@ -20,6 +21,9 @@
<depend>pacmod_msgs</depend>
<depend>std_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
4 changes: 4 additions & 0 deletions vehicle/as/src/pacmod_interface/pacmod_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <algorithm>
#include <memory>
#include <utility>

#include "pacmod_interface/pacmod_interface.hpp"

PacmodInterface::PacmodInterface()
Expand Down
2 changes: 2 additions & 0 deletions vehicle/as/src/pacmod_interface/pacmod_interface_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <memory>

#include "rclcpp/rclcpp.hpp"

#include "pacmod_interface/pacmod_interface.hpp"
Expand Down
7 changes: 6 additions & 1 deletion vehicle/as/src/ssc_interface/ssc_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <memory>
#include <string>
#include <utility>

#include "ssc_interface/ssc_interface.hpp"

SSCInterface::SSCInterface()
Expand Down Expand Up @@ -190,7 +194,8 @@ void SSCInterface::callbackFromSSCFeedbacks(
const double steering_angle = std::atan(curvature * wheel_base_);
// constexpr double tread = 1.64; // spec sheet 1.63
// double omega =
// (-msg_wheel_speed->rear_right_wheel_speed + msg_wheel_speed->rear_left_wheel_speed) * tire_radius_ / tread;
// (-msg_wheel_speed->rear_right_wheel_speed + msg_wheel_speed->rear_left_wheel_speed) *
// tire_radius_ / tread;

// as_current_velocity (geometry_msgs::msg::TwistStamped)
geometry_msgs::msg::TwistStamped twist;
Expand Down
2 changes: 2 additions & 0 deletions vehicle/as/src/ssc_interface/ssc_interface_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <memory>

#include "ssc_interface/ssc_interface.hpp"

#include "rclcpp/rclcpp.hpp"
Expand Down

0 comments on commit a31d78d

Please sign in to comment.