Skip to content

Commit

Permalink
Merge pull request #8 from Alpaca-zip/feature/industrial_ci
Browse files Browse the repository at this point in the history
Add ROS Noetic Industrial CI Pipeline
  • Loading branch information
Alpaca-zip authored Sep 9, 2023
2 parents 98e8878 + e2c1a9c commit e6628e0
Show file tree
Hide file tree
Showing 21 changed files with 532 additions and 301 deletions.
84 changes: 70 additions & 14 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,19 +1,75 @@
---
Language: Cpp
BasedOnStyle: Google
BasedOnStyle: Google
ColumnLimit: 120
MaxEmptyLinesToKeep: 1
SortIncludes: false

Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
ConstructorInitializerIndentWidth: 2
NamespaceIndentation: None
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentFunctionDeclarationAfterType: false

AlignEscapedNewlinesLeft: false
AlignTrailingComments: true

AllowAllParametersOfDeclarationOnNextLine: false
ExperimentalAutoDetectBinPacking: false
ObjCSpaceBeforeProtocolList: true
Cpp11BracedListStyle: false

AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortCaseLabelsOnASingleLine: false

AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true

BinPackParameters: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true

PenaltyExcessCharacter: 50
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 1000
PenaltyBreakFirstLessLess: 10
PenaltyBreakString: 100
PenaltyReturnTypeOnItsOwnLine: 50

SpacesBeforeTrailingComments: 2
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom
ColumnLimit: 100
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
DerivePointerAlignment: false
PointerAlignment: Middle
ReflowComments: false

# Control of individual brace wrapping cases
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
...
50 changes: 50 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
Checks: '-*,
performance-*,
llvm-namespace-comment,
modernize-redundant-void-arg,
modernize-use-nullptr,
modernize-use-default,
modernize-use-override,
modernize-loop-convert,
readability-named-parameter,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-simplify-boolean-expr,
readability-container-size-empty,
readability-identifier-naming,
'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
CheckOptions:
- key: llvm-namespace-comment.ShortNamespaceLines
value: '10'
- key: llvm-namespace-comment.SpacesBeforeComments
value: '2'
- key: readability-braces-around-statements.ShortStatementLines
value: '2'
# type names
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
# method names
- key: readability-identifier-naming.MethodCase
value: camelBack
# variable names
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ClassMemberSuffix
value: '_'
# const static or global variables are UPPER_CASE
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ClassConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalVariableCase
value: UPPER_CASE
...
25 changes: 0 additions & 25 deletions .github/workflows/formatter.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/noetic-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: ROS-noetic Industrial CI
on:
pull_request:

jobs:
clang_format_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic
CLANG_FORMAT_CHECK: file
CLANG_FORMAT_VERSION: "10"

clang_tidy_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic
UPSTREAM_WORKSPACE: pupbot.rosinstall
CLANG_TIDY: pedantic

black_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic
BLACK_CHECK: true

pylint_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic
UPSTREAM_WORKSPACE: pupbot.rosinstall
PYLINT_CHECK: true

catkin_lint_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic
UPSTREAM_WORKSPACE: pupbot.rosinstall
CATKIN_LINT: true

build_check:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
env:
- ROS_DISTRO: noetic
ROS_REPO: main
UPSTREAM_WORKSPACE: pupbot.rosinstall
IMMEDIATE_TEST_OUTPUT: true
- ROS_DISTRO: noetic
ROS_REPO: testing
UPSTREAM_WORKSPACE: pupbot.rosinstall
IMMEDIATE_TEST_OUTPUT: true

steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
32 changes: 0 additions & 32 deletions .github/workflows/ros1-build-check-bot.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode
compile_commands.json
18 changes: 12 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ cmake_minimum_required(VERSION 3.0.2)
project(pupbot)

find_package(catkin REQUIRED COMPONENTS
dynamixel_workbench_toolbox
geometry_msgs
roscpp
std_msgs
sensor_msgs
geometry_msgs
std_msgs
trajectory_msgs
dynamixel_workbench_toolbox
)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp std_msgs sensor_msgs geometry_msgs trajectory_msgs
CATKIN_DEPENDS geometry_msgs roscpp sensor_msgs std_msgs trajectory_msgs
)

link_directories(${GAZEBO_LIBRARY_DIRS})

include_directories(
include
${catkin_INCLUDE_DIRS}
Expand All @@ -34,3 +32,11 @@ target_link_libraries(key_control ${catkin_LIBRARIES})
target_link_libraries(posture_stabilization ${catkin_LIBRARIES})
target_link_libraries(standing_motion ${catkin_LIBRARIES})
target_link_libraries(trot_gait ${catkin_LIBRARIES})

install(TARGETS dynamixel_control inverse_kinematics key_control posture_stabilization standing_motion trot_gait
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY include
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PupBot [![ROS-noetic Build Check](https://github.com/Alpaca-zip/pupbot/actions/workflows/ros1-build-check-bot.yml/badge.svg?event=pull_request)](https://github.com/Alpaca-zip/pupbot/actions/workflows/ros1-build-check-bot.yml) [![Docker Build Check](https://github.com/Alpaca-zip/pupbot/actions/workflows/docker-build-check-bot.yml/badge.svg?event=pull_request)](https://github.com/Alpaca-zip/pupbot/actions/workflows/docker-build-check-bot.yml)
# PupBot [![ROS-noetic Industrial CI](https://github.com/Alpaca-zip/pupbot/actions/workflows/noetic-ci.yml/badge.svg)](https://github.com/Alpaca-zip/pupbot/actions/workflows/noetic-ci.yml) [![Docker Build Check](https://github.com/Alpaca-zip/pupbot/actions/workflows/docker-build-check-bot.yml/badge.svg?event=pull_request)](https://github.com/Alpaca-zip/pupbot/actions/workflows/docker-build-check-bot.yml)
ROS package for quadruped robot PupBot.

[![dockeri.co](https://dockerico.blankenship.io/image/alpacazip/pupbot)](https://hub.docker.com/r/alpacazip/pupbot)
Expand Down
16 changes: 8 additions & 8 deletions include/dynamixel_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define RF_LEG_UPPER_ID 1
#define RF_LEG_LOWER_ID 13

class dynamixelControl
class DynamixelControl
{
private:
ros::NodeHandle _nh;
Expand All @@ -55,17 +55,17 @@ class dynamixelControl
int _model_number_int;
uint8_t _dxl_id[12];
uint16_t _model_number;
const char * _log;
const char * _port_name;
const char* _log;
const char* _port_name;
DynamixelWorkbench _dxl_wb;

public:
dynamixelControl();
DynamixelControl();
void controlLoop();
void monitorLFLegCallback(const trajectory_msgs::JointTrajectory & LF_leg);
void monitorLRLegCallback(const trajectory_msgs::JointTrajectory & LR_leg);
void monitorRRLegCallback(const trajectory_msgs::JointTrajectory & RR_leg);
void monitorRFLegCallback(const trajectory_msgs::JointTrajectory & RF_leg);
void monitorLFLegCallback(const trajectory_msgs::JointTrajectory& LF_leg);
void monitorLRLegCallback(const trajectory_msgs::JointTrajectory& LR_leg);
void monitorRRLegCallback(const trajectory_msgs::JointTrajectory& RR_leg);
void monitorRFLegCallback(const trajectory_msgs::JointTrajectory& RF_leg);
void dxlInit();
void dxlTorqueOn();
void dxlAddSyncWriteHandler();
Expand Down
6 changes: 3 additions & 3 deletions include/inverse_kinematics.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define BONE_LENGTH 83.0
#define LENGTH 21.0

class inverseKinematics
class InverseKinematics
{
private:
ros::NodeHandle _nh;
Expand All @@ -38,6 +38,6 @@ class inverseKinematics
double _duration;

public:
inverseKinematics();
void inverseKinematicsCallback(const std_msgs::Float64MultiArray & leg_position);
InverseKinematics();
void inverseKinematicsCallback(const std_msgs::Float64MultiArray& leg_position);
};
Loading

0 comments on commit e6628e0

Please sign in to comment.