Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Code Style] [merge after #566] Format code in aerial_robot_base #567

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping:
AfterClass: true
AfterControlStatement: 'true'
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
19 changes: 19 additions & 0 deletions .github/workflows/uml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: generate plantuml
on: push
jobs:
generate_plantuml:
runs-on: ubuntu-latest
name: plantuml
steps:
- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: plantuml
id: plantuml
uses: grassedge/[email protected]
with:
path: docs/UMLs
message: "Render PlantUML files"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
.LSOverride

# Icon must end with two \r
Icon
Icon


# Thumbnails
._*
Expand Down Expand Up @@ -101,4 +102,8 @@ tags


# python
*.pyc
*.pyc

# Jetbrains
.idea/
*cmake-build-debug/
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: check-xml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files

# Python
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
language: python
args: [--line-length=120]

# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.3
hooks:
- id: clang-format

# # YAML - still bad support for comments in YAML files
# - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
# rev: 0.2.1 # or other specific tag
# hooks:
# - id: yamlfmt
# args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '120']
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ catkin build

## Demo
Please check instruction in [wiki](https://github.com/JSKAerialRobot/aerial_robot/wiki).


14 changes: 7 additions & 7 deletions aerial_robot_base/config/sensors/altimeter/baro.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sensor_plugin:
altitude:
barometer_sub_name: baro
baro_noise_sigma: 0.2
baro_bias_noise_sigma: 0.001
rx_freq: 80.0
cutoff_freq: 10.0
high_cutoff_freq: 1.0
altitude:
barometer_sub_name: baro
baro_noise_sigma: 0.2
baro_bias_noise_sigma: 0.001
rx_freq: 80.0
cutoff_freq: 10.0
high_cutoff_freq: 1.0
16 changes: 8 additions & 8 deletions aerial_robot_base/config/sensors/altimeter/leddar_one.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sensor_plugin:
alt:
range_noise_sigma: 0.01 #old: 0.005
range_sensor_sub_name: leddar_one/range
sensor_frame: leddarone
reference_frame: fc
no_height_offset: true
time_sync: false
delay: 0
alt:
range_noise_sigma: 0.01 #old: 0.005
range_sensor_sub_name: leddar_one/range
sensor_frame: leddarone
reference_frame: fc
no_height_offset: true
time_sync: false
delay: 0
11 changes: 5 additions & 6 deletions aerial_robot_base/config/sensors/altimeter/sonar.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
sensor_plugin:
range_sensor:
range_noise_sigma: 0.02
range_sensor_sub_name: /sonar
ascending_check_range: 0.095
calibrate_cnt: 10

range_sensor:
range_noise_sigma: 0.02
range_sensor_sub_name: /sonar
ascending_check_range: 0.095
calibrate_cnt: 10
20 changes: 10 additions & 10 deletions aerial_robot_base/config/sensors/gps/ublox_m8n.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sensor_plugin:
gps: #single GPS
min_est_sat_num: 7
vel_noise_sigma: 0.02 #0.05 -> 0.01 -> 0.02
pos_noise_sigma: 1.0
gps_ros_sub_name: sim/gps/fix
sensor_frame: gps
ned_flag: true #north(x)-east(y)-down(z) frame
time_sync: true
delay: -0.45 # daylight: -0.45, night: -0.5
#only_use_vel: true # debug
gps: #single GPS
min_est_sat_num: 7
vel_noise_sigma: 0.02 #0.05 -> 0.01 -> 0.02
pos_noise_sigma: 1.0
gps_ros_sub_name: sim/gps/fix
sensor_frame: gps
ned_flag: true #north(x)-east(y)-down(z) frame
time_sync: true
delay: -0.45 # daylight: -0.45, night: -0.5
#only_use_vel: true # debug
20 changes: 10 additions & 10 deletions aerial_robot_base/config/sensors/gps/ublox_m9n.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sensor_plugin:
gps: #single GPS
min_est_sat_num: 10
vel_noise_sigma: 0.02 #0.05 -> 0.01 -> 0.02
pos_noise_sigma: 1.0
gps_ros_sub_name: sim/gps/fix
sensor_frame: gps
ned_flag: true #north(x)-east(y)-down(z) frame
time_sync: true
delay: -0.35 # alternative: -0.25 # Ublox M9N normal: -0.25 ~ 0.35, -0.35 is good @2021.05.24 Kashiwa. TODO: auto-calibra with VIO
#only_use_vel: true # debug
gps: #single GPS
min_est_sat_num: 10
vel_noise_sigma: 0.02 #0.05 -> 0.01 -> 0.02
pos_noise_sigma: 1.0
gps_ros_sub_name: sim/gps/fix
sensor_frame: gps
ned_flag: true #north(x)-east(y)-down(z) frame
time_sync: true
delay: -0.35 # alternative: -0.25 # Ublox M9N normal: -0.25 ~ 0.35, -0.35 is good @2021.05.24 Kashiwa. TODO: auto-calibra with VIO
#only_use_vel: true # debug
23 changes: 11 additions & 12 deletions aerial_robot_base/config/sensors/gps/ublox_rtk_m8p.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# Note: we need a normal GPS as gps1, otherwise following yaml file would be never loaded

sensor_plugin:
gps2: # we need a normal GPS as gps1, otherwise following yaml file would be never loaded
rtk: true
min_est_sat_num: 10
pos_noise_sigma: 1.0
gps_ros_sub_name: rtk_gps/fix
rtk_pos_sub_name: rtk_gps/rel_pos
sensor_frame: rtk_gps
ned_flag: true #north(x)-east(y)-down(z) frame
time_sync: true
delay: -0.25
#rtk_offset: false # Please overwrite this parameter in your StateEstimation.yaml. **Not Here!!*. True: set the takeoff point as zero for RTK model, otherwise, the zero point is the base station like mocap. Default is false

gps2: # we need a normal GPS as gps1, otherwise following yaml file would be never loaded
rtk: true
min_est_sat_num: 10
pos_noise_sigma: 1.0
gps_ros_sub_name: rtk_gps/fix
rtk_pos_sub_name: rtk_gps/rel_pos
sensor_frame: rtk_gps
ned_flag: true #north(x)-east(y)-down(z) frame
time_sync: true
delay: -0.25
#rtk_offset: false # Please overwrite this parameter in your StateEstimation.yaml. **Not Here!!*. True: set the takeoff point as zero for RTK model, otherwise, the zero point is the base station like mocap. Default is false
16 changes: 8 additions & 8 deletions aerial_robot_base/config/sensors/imu/spinal.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sensor_plugin:
imu:
imu_topic_name: imu
level_acc_noise_sigma: 0.05
z_acc_noise_sigma: 0.05
level_acc_bias_noise_sigma: 0.001 # (> 0 means to do the acc bias estimation by kalman filter)
z_acc_bias_noise_sigma: 0.001 # (= 0 means not to do the acc bias estimation by kalman filter)
angle_bias_noise_sigma: 0.0002 #good for EKF
calib_time: 2.0
imu:
imu_topic_name: imu
level_acc_noise_sigma: 0.05
z_acc_noise_sigma: 0.05
level_acc_bias_noise_sigma: 0.001 # (> 0 means to do the acc bias estimation by kalman filter)
z_acc_bias_noise_sigma: 0.001 # (= 0 means not to do the acc bias estimation by kalman filter)
angle_bias_noise_sigma: 0.0002 #good for EKF
calib_time: 2.0
16 changes: 8 additions & 8 deletions aerial_robot_base/config/sensors/mocap.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sensor_plugin:
mocap:
pos_noise_sigma: 0.0002
angle_sigma: 0.005
acc_bias_noise_sigma: 0.001 # force acc bias estimation by kalman filter
unhealth_level: 3
health_timeout: 0.5
time_sync: false
mocap_sub_name: mocap/pose
mocap:
pos_noise_sigma: 0.0002
angle_sigma: 0.005
acc_bias_noise_sigma: 0.001 # force acc bias estimation by kalman filter
unhealth_level: 3
health_timeout: 0.5
time_sync: false
mocap_sub_name: mocap/pose
14 changes: 7 additions & 7 deletions aerial_robot_base/include/aerial_robot_base/aerial_robot_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ using namespace std;

class AerialRobotBase
{
public:
AerialRobotBase(ros::NodeHandle nh, ros::NodeHandle nh_private);
public:
AerialRobotBase(const ros::NodeHandle& nh, const ros::NodeHandle& nh_private);
~AerialRobotBase();

void mainFunc(const ros::TimerEvent & e);
void mainFunc(const ros::TimerEvent& e);

private:
private:
ros::NodeHandle nh_;
ros::NodeHandle nhp_;
ros::Timer main_timer_;

boost::shared_ptr<aerial_robot_model::RobotModelRos> robot_model_ros_;
boost::shared_ptr<aerial_robot_estimation::StateEstimator> estimator_;
boost::shared_ptr<aerial_robot_estimation::StateEstimator> estimator_;

pluginlib::ClassLoader<aerial_robot_navigation::BaseNavigator> navigator_loader_;
boost::shared_ptr<aerial_robot_navigation::BaseNavigator> navigator_;

pluginlib::ClassLoader<aerial_robot_control::ControlBase> controller_loader_;
boost::shared_ptr<aerial_robot_control::ControlBase> controller_;

ros::AsyncSpinner callback_spinner_; // Use 4 threads
ros::AsyncSpinner main_loop_spinner_; // Use 1 threads
ros::AsyncSpinner callback_spinner_; // Use 4 threads
ros::AsyncSpinner main_loop_spinner_; // Use 1 threads
ros::CallbackQueue main_loop_queue_;
};
10 changes: 5 additions & 5 deletions aerial_robot_base/launch/external_module/joy_stick.launch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<launch>

<arg name="robot_name" default="/" />
<arg name="robot_name" default="/"/>

<node pkg="joy" type="joy_node" name="joy_node" ns="$(arg robot_name)" output="screen" >
<node pkg="joy" type="joy_node" name="joy_node" ns="$(arg robot_name)" output="screen">

<param name="dev" value="/dev/input/js0"/>
<param name="coalesce_interval" value="0.025"/>
</node>
<param name="dev" value="/dev/input/js0"/>
<param name="coalesce_interval" value="0.025"/>
</node>
</launch>
42 changes: 21 additions & 21 deletions aerial_robot_base/launch/external_module/mocap.launch
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<launch>

<arg name="robot_id" default="1"/>
<arg name="robot_id" default="1"/>

<node pkg="mocap_optitrack"
type="mocap_node"
name="mocap_node"
respawn="false"
launch-prefix=""
required="true">
<rosparam subst_value="true">
rigid_bodies:
'$(arg robot_id)':
pose: mocap/pose
pose2d: mocap/ground_pose
child_frame_id: baselink
parent_frame_id: world
optitrack_config:
multicast_address: 239.255.42.99
command_port: 1510
data_port: 1511
</rosparam>
<remap from="~mocap/pose" to="mocap/pose" />
</node>
<node pkg="mocap_optitrack"
type="mocap_node"
name="mocap_node"
respawn="false"
launch-prefix=""
required="true">
<rosparam subst_value="true">
rigid_bodies:
'$(arg robot_id)':
pose: mocap/pose
pose2d: mocap/ground_pose
child_frame_id: baselink
parent_frame_id: world
optitrack_config:
multicast_address: 239.255.42.99
command_port: 1510
data_port: 1511
</rosparam>
<remap from="~mocap/pose" to="mocap/pose"/>
</node>

</launch>
Loading
Loading