Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
52a8387
Remove useless character
vincentrou Jul 3, 2017
0f83e8e
param handler now generates python parameter files too
poggenhans Dec 28, 2016
f34f612
Fix initialisation order in parameter class template
olesalscheider Mar 20, 2017
9dd15bd
Set default values on parameter server if no value is set
jhpauls Jan 9, 2017
d331bb6
Include python usage in documentation
poggenhans Jul 11, 2017
84ff1a4
Add min/max check for map and vector to be consistent with C++
poggenhans Jul 11, 2017
87c050a
Handler is now throwing an exception upon failure.
cbandera Aug 20, 2017
8a5bab0
Moved common functions to utilities.hpp. Fixes #11
cbandera Aug 20, 2017
5bbd0d5
Updated README to include release information. Closes #17.
cbandera Aug 20, 2017
bbd4de2
Added LICENSE file. Closes #25
cbandera Aug 20, 2017
32e2450
Added first set of tests
cbandera Aug 20, 2017
233b48a
Added initial travis config
cbandera Aug 20, 2017
1d02859
Added matrix job and removed C++14 check
cbandera Aug 20, 2017
158b22e
Updated README contribution guide
cbandera Aug 20, 2017
4bacbbf
Changed build flag to display develop branch
cbandera Aug 20, 2017
dffb6a3
Merge pull request #26 from cbandera/feature/add_continous_integration
cbandera Aug 20, 2017
97b647b
Merge remote-tracking branch 'cbandera/develop' into python_support
poggenhans Aug 27, 2017
30eb393
Add python unittests
poggenhans Aug 27, 2017
f0be113
Throw more informative exception if parameters without default value …
poggenhans Aug 27, 2017
2cf0e8b
Name tests properly, add cmake dependency
poggenhans Aug 27, 2017
b504810
Merge remote-tracking branch 'cbandera/develop' into set_defaults_on_…
poggenhans Aug 28, 2017
86796e2
Add unittests
poggenhans Aug 28, 2017
83d3523
Remove duplicate test
poggenhans Aug 28, 2017
07d52f8
Updated the documentation
cbandera Aug 29, 2017
d8c8cbc
Merge pull request #22 from poggenhans/set_defaults_on_param_server
cbandera Aug 29, 2017
3204fdb
Merge branch 'develop' into python_support
cbandera Aug 29, 2017
b20f66e
Merge branch 'develop' into fix_init_order
cbandera Aug 29, 2017
3eb9f78
Merge branch 'develop' into patch-1
cbandera Aug 29, 2017
5fcce2c
Merge pull request #19 from vincentrou/patch-1
cbandera Aug 29, 2017
d3878c5
Merged branch develop into fix_init_order
cbandera Aug 29, 2017
8cf6cca
Fixed merge error in template
cbandera Aug 29, 2017
f04cb08
Merge pull request #21 from poggenhans/fix_init_order
cbandera Aug 29, 2017
a9e1890
Merge branch 'develop' into python_support
cbandera Aug 29, 2017
8321c3d
Removed verbose output during build
cbandera Aug 29, 2017
b75fae0
Force travis to do a clean build
cbandera Aug 29, 2017
68c219e
Readded check for C++11 support.
cbandera Aug 29, 2017
a92a192
Merged branch develop into bugfix/force_clean_builds
cbandera Aug 29, 2017
c43f5f6
Merge pull request #29 from cbandera/bugfix/force_clean_builds
cbandera Aug 29, 2017
8a0c76c
Merge branch 'develop' into python_support
cbandera Aug 29, 2017
cc2703d
Remove useless comment leftovers
poggenhans Aug 30, 2017
37c88d9
Set default values on param server, add python tests for that
poggenhans Aug 30, 2017
07c526a
Made tests visible
cbandera Aug 31, 2017
60642d8
Replaced errors with warnings
cbandera Aug 31, 2017
f6d3fec
Display correct test names for each test
poggenhans Aug 31, 2017
d3c58f8
Merge pull request #20 from poggenhans/python_support
cbandera Sep 1, 2017
718d617
First draft implementation of yaml generator for #30
cbandera Sep 11, 2017
cba741b
Removed debugging leftover
cbandera Sep 12, 2017
66c004e
Moved common function to util header
cbandera Sep 13, 2017
6f68db6
Added documentation to functions
cbandera Sep 14, 2017
094ce23
Added functionality for setting parameters on server.
cbandera Sep 15, 2017
4e969e8
Fix for failing tests
cbandera Sep 15, 2017
3f0b727
Simplified utility functions
cbandera Sep 15, 2017
79c715f
ClangFormat files
cbandera Sep 15, 2017
16e88a9
Reformatted python files
cbandera Sep 15, 2017
b54b7d9
Merge pull request #32 from cbandera/feature/toParamServer
cbandera Sep 15, 2017
c8cd086
Merge remote-tracking branch 'origin/develop' into feature/generate_yaml
cbandera Sep 15, 2017
0f0af52
Added documentation for generator script
cbandera Sep 15, 2017
9134a50
Uncomment lines without default, to force user to set them
cbandera Sep 15, 2017
ee68c64
Bugfixes
cbandera Sep 16, 2017
3fa3f47
Renamed script again
cbandera Sep 16, 2017
64a23fa
Merge pull request #33 from cbandera/feature/generate_yaml
cbandera Sep 16, 2017
0bd890a
add dynamic_reconfigure test
Jan 10, 2018
01f2c5e
std::endl -> \n
Jan 10, 2018
096d4b5
Merge pull request #39 from cbandera/test/dynamic_reconf
artivis Jan 10, 2018
a31e7be
update maintainer
Jan 10, 2018
c650412
Merge pull request #40 from cbandera/update_maintainer
artivis Jan 10, 2018
8a69587
fix #34
Feb 4, 2018
68bbd06
Merge pull request #43 from cbandera/fix/compile
artivis Feb 4, 2018
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
92 changes: 92 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\/.*\/.*>'
Priority: 3
- Regex: '^<.*\/.*>'
Priority: 2
- Regex: '^<.*>'
Priority: 1
- Regex: '^".*\/.*\/.*"'
Priority: 6
- Regex: '^".*\/.*"'
Priority: 5
- Regex: '^".*"'
Priority: 4
- Regex: '.*'
Priority: 7
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 2000
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
122 changes: 122 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Generic .travis.yml file for running continuous integration on Travis-CI for
# any ROS package.
#
# Available here:
# - http://felixduvallet.github.io/ros-travis-integration
# - https://github.com/felixduvallet/ros-travis-integration
#
# This installs ROS on a clean Travis-CI virtual machine, creates a ROS
# workspace, resolves all listed dependencies, and sets environment variables
# (setup.bash). Then, it compiles the entire ROS workspace (ensuring there are
# no compilation errors), and runs all the tests. If any of the compilation/test
# phases fail, the build is marked as a failure.
#
# We handle two types of package dependencies specified in the package manifest:
# - system dependencies that can be installed using `rosdep`, including other
# ROS packages and system libraries. These dependencies must be known to
# `rosdistro` and get installed using apt-get.
# - package dependencies that must be checked out from source. These are handled by
# `wstool`, and should be listed in a file named dependencies.rosinstall.
#
# There are two variables you may want to change:
# - ROS_DISTRO (default is indigo). Note that packages must be available for
# ubuntu 14.04 trusty.
# - ROSINSTALL_FILE (default is dependencies.rosinstall inside the repo
# root). This should list all necessary repositories in wstool format (see
# the ros wiki). If the file does not exists then nothing happens.
#
# See the README.md for more information.
#
# Author: Felix Duvallet <felixd@gmail.com>

# NOTE: The build lifecycle on Travis.ci is something like this:
# before_install
# install
# before_script
# script
# after_success or after_failure
# after_script
# OPTIONAL before_deploy
# OPTIONAL deploy
# OPTIONAL after_deploy

################################################################################

# Use ubuntu trusty (14.04) with sudo privileges.
dist: trusty
sudo: required
language:
- generic
cache:
- apt

# Configuration variables. All variables are global now, but this can be used to
# trigger a build matrix for different ROS distributions if desired.
env:
global:
- ROS_CI_DESKTOP="`lsb_release -cs`" # e.g. [precise|trusty|...]
- CI_SOURCE_PATH=$(pwd)
- ROSINSTALL_FILE=$CI_SOURCE_PATH/dependencies.rosinstall
- CATKIN_OPTIONS=$CI_SOURCE_PATH/catkin.options
- ROS_PARALLEL_JOBS='-j8 -l6'
# Set the python path manually to include /usr/-/python2.7/dist-packages
# as this is where apt-get installs python packages.
- PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages
matrix:
- ROS_DISTRO=indigo
- ROS_DISTRO=jade
################################################################################

# Install system dependencies, namely a very barebones ROS setup.
before_install:
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
- sudo apt-get update -qq
- sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update

# Create a catkin workspace with the package under integration.
install:
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/src
- catkin_init_workspace
# Create the devel/setup.bash (run catkin_make with an empty workspace) and
# source it to set the path variables.
- cd ~/catkin_ws
- catkin_make
- source devel/setup.bash
# Add the package under integration to the workspace using a symlink.
- cd ~/catkin_ws/src
- ln -s $CI_SOURCE_PATH .

# Install all dependencies, using wstool first and rosdep second.
# wstool looks for a ROSINSTALL_FILE defined in the environment variables.
before_script:
# source dependencies: install using wstool.
- cd ~/catkin_ws/src
- wstool init
- if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
- wstool up
# package depdencies: install using rosdep.
- cd ~/catkin_ws
- rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

# Compile and test (mark the build as failed if any step fails). If the
# CATKIN_OPTIONS file exists, use it as an argument to catkin_make, for example
# to blacklist certain packages.
#
# NOTE on testing: `catkin_make run_tests` will show the output of the tests
# (gtest, nosetest, etc..) but always returns 0 (success) even if a test
# fails. Running `catkin_test_results` aggregates all the results and returns
# non-zero when a test fails (which notifies Travis the build failed).
script:
- source /opt/ros/$ROS_DISTRO/setup.bash
- cd ~/catkin_ws
- rm -rf build/ devel/
- catkin_make $( [ -f $CATKIN_OPTIONS ] && cat $CATKIN_OPTIONS )
# Run the tests, ensuring the path is set correctly.
- source devel/setup.bash
- catkin_make run_tests && catkin_test_results
35 changes: 34 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ find_package(catkin REQUIRED)

catkin_python_setup()

if (CATKIN_ENABLE_TESTING)
# set compiler flags
find_package(catkin REQUIRED COMPONENTS dynamic_reconfigure rostest roscpp)
set(ROSPARAM_HANDLER_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake)
include(cmake/rosparam_handler-macros.cmake)
file(GLOB PROJECT_TEST_FILES_PARAMS RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "test/cfg/*.params")
generate_ros_parameter_files(${PROJECT_TEST_FILES_PARAMS})
endif()

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS catkin
Expand All @@ -24,4 +33,28 @@ install(
install(
DIRECTORY include/rosparam_handler
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
)

install(PROGRAMS scripts/generate_yaml
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

if (CATKIN_ENABLE_TESTING)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" Cpp11CompilerFlag)
if (${Cpp11CompilerFlag})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
message(FATAL_ERROR "Compiler does not have c++11 support.")
endif()

file(GLOB PROJECT_TEST_FILES_SRC RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "test/src/*.cpp")
set(TEST_TARGET_NAME "rosparam_handler_test")
add_rostest_gtest(${TEST_TARGET_NAME} test/launch/rosparam_handler.test ${PROJECT_TEST_FILES_SRC})
add_rostest(test/launch/rosparam_handler_python.test DEPENDENCIES ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(${TEST_TARGET_NAME} ${catkin_LIBRARIES} gtest)
target_include_directories(${TEST_TARGET_NAME} PUBLIC ${catkin_INCLUDE_DIRS} include)
add_dependencies(${TEST_TARGET_NAME} ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
set_property(TARGET ${TEST_TARGET_NAME} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${TEST_TARGET_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
endif()
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2017, Claudio Bandera
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN 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.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# rosparam_handler
[![Build Status](https://travis-ci.org/cbandera/rosparam_handler.svg?branch=develop)](https://travis-ci.org/cbandera/rosparam_handler)

## Package Summary
A unified parameter handler for nodes with automatic code generation.
Save time on defining your parameters. No more redundant code. Easy error checking. Make them dynamic with a single flag.

- Maintainer status: maintained
- Maintainer: Claudio Bandera <cbandera@posteo.de>
- Maintainer: Jeremie Deray <jeremie.deray@pal-robotics.com>
- Author: Claudio Bandera <cbandera@posteo.de>
- License: BSD
- Bug / feature tracker: https://github.com/cbandera/rosparam_handler/issues
Expand All @@ -25,13 +27,39 @@ The `rosparam_handler` let's you:
- set default, min and max values
- choose between global and private namespace
- save a lot of time on specifying your parameters in several places.
- ...in both C++ and Python

## Usage
See the Tutorials on
- [How to write your first .params file](doc/HowToWriteYourFirstParamsFile.md)
- [How to use your parameter struct](doc/HowToUseYourParameterStruct.md)
- [rosparam_handler_tutorial](https://github.com/cbandera/rosparam_handler_tutorial)

## Installation
`rosparam_handler` has been released in version `0.1.1` for
- indigo
- jade
- kinetic

To get the package run
`rosdep update && rosdep install rosparam_handler`

## Contribution
`rosparam_handler` is developed according to Vincent Driessen's [Gitflow Workflow](http://nvie.com/posts/a-successful-git-branching-model/).
This means,
- the master branch is for releases only.
- development is done on feature branches
- finished features are integrated via PullRequests into develop.

For a PullRequest to get merged into develop, it must pass
- Review by one of the maintainers.
+ Are the changes introduces in scope of the rosparam_handler?
+ Is the documentation updated?
+ Are enough reasonable tests added?
+ Will these changes break the API?
+ Do the new changes follow the current style of naming?
- Compile / Test / Run on all target environments.

## Credits
This project uses Open Source components. The code was, in large parts, built upon such existing open source software. You can find the source code of their projects along with license information below. We acknowledge and are grateful to these developers for their contributions to open source.

Expand Down
Loading