Skip to content

Commit

Permalink
Replace Travis CI with GitHub workflow and lint (#102)
Browse files Browse the repository at this point in the history
* Replace Travis CI with GitHub workflow

Using the actions provided by ros-tooling makes things a lot simpler.
Run CI on all PRs targeting foxy.

* Use testing repository in CI

So we can build against the latest released version of libcreate.

* Fix lint tests

Signed-off-by: Jacob Perron <jacobmperron@gmail.com>
  • Loading branch information
jacobperron committed May 14, 2023
1 parent 5124b31 commit e26f27d
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 165 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build_and_test.yml
@@ -0,0 +1,20 @@
name: Continuous Integration

on:
push:
branches: ['foxy']
pull_request:

jobs:
build_and_test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/setup-ros@v0.6
with:
required-ros-distributions: foxy
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3
with:
package-name: create_bringup create_description create_driver create_msgs create_robot
target-ros2-distro: foxy
5 changes: 5 additions & 0 deletions create_driver/CMakeLists.txt
Expand Up @@ -40,6 +40,11 @@ ament_target_dependencies(${PROJECT_NAME}
)

if(BUILD_TESTING)
# Skip copyright lint and uncrustify
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_uncrustify_FOUND TRUE)
# Set language to C++, otherwise cppcheck assumes header file with .h is C
set(ament_cmake_cppcheck_LANGUAGE c++)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
Expand Down
1 change: 1 addition & 0 deletions create_driver/CPPLINT.cfg
@@ -0,0 +1 @@
linelength=120
41 changes: 21 additions & 20 deletions create_driver/include/create_driver/create_driver.h
Expand Up @@ -25,8 +25,11 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CREATE_DRIVER_CREATE_DRIVER_H
#define CREATE_DRIVER_CREATE_DRIVER_H

#ifndef CREATE_DRIVER__CREATE_DRIVER_H_
#define CREATE_DRIVER__CREATE_DRIVER_H_
#include <string>

#include "create_msgs/msg/charging_state.hpp"
#include "create_msgs/msg/mode.hpp"
#include "create_msgs/msg/bumper.hpp"
Expand All @@ -37,21 +40,19 @@ POSSIBILITY OF SUCH DAMAGE.

#include "create/create.h"

#include <diagnostic_updater/diagnostic_updater.hpp>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <geometry_msgs/msg/twist.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/joint_state.hpp>
#include <std_msgs/msg/bool.hpp>
#include <std_msgs/msg/empty.hpp>
#include <std_msgs/msg/float32.hpp>
#include <std_msgs/msg/int16.hpp>
#include <std_msgs/msg/u_int16.hpp>
#include <std_msgs/msg/u_int8_multi_array.hpp>
#include <tf2_ros/transform_broadcaster.h>

#include <string>
#include "diagnostic_updater/diagnostic_updater.hpp"
#include "geometry_msgs/msg/transform_stamped.hpp"
#include "geometry_msgs/msg/twist.hpp"
#include "nav_msgs/msg/odometry.hpp"
#include "rclcpp/rclcpp.hpp"
#include "sensor_msgs/msg/joint_state.hpp"
#include "std_msgs/msg/bool.hpp"
#include "std_msgs/msg/empty.hpp"
#include "std_msgs/msg/float32.hpp"
#include "std_msgs/msg/int16.hpp"
#include "std_msgs/msg/u_int16.hpp"
#include "std_msgs/msg/u_int8_multi_array.hpp"
#include "tf2_ros/transform_broadcaster.h"

static const double COVARIANCE[36] = {1e-5, 1e-5, 0.0, 0.0, 0.0, 1e-5, // NOLINT(whitespace/braces)
1e-5, 1e-5, 0.0, 0.0, 0.0, 1e-5,
Expand Down Expand Up @@ -126,7 +127,7 @@ class CreateDriver : public rclcpp::Node
std::string dev_;
std::string base_frame_;
std::string odom_frame_;
double latch_duration_;
rclcpp::Duration latch_duration_;
double loop_hz_;
bool publish_tf_;
int baud_;
Expand Down Expand Up @@ -164,9 +165,9 @@ class CreateDriver : public rclcpp::Node
void publishCliff();

public:
explicit CreateDriver();
CreateDriver();
~CreateDriver();
virtual void spinOnce();
}; // class CreateDriver

#endif // CREATE_DRIVER_CREATE_DRIVER_H
#endif // CREATE_DRIVER__CREATE_DRIVER_H_

0 comments on commit e26f27d

Please sign in to comment.