Coder Social home page Coder Social logo

krause92 / rosparam_shortcuts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from picknikrobotics/rosparam_shortcuts

0.0 0.0 0.0 90 KB

Quickly load variables from rosparam with good command line error checking.

CMake 7.84% C++ 82.79% C 9.38%

rosparam_shortcuts's Introduction

ROS Param Shortcuts

Quickly load variables from rosparam with good command line error checking.

This package enforces the philosophy that there should be no default parameters - everything must be defined by the user in yaml files (or launch files or where ever) otherwise your program should not run. This helps debug why something isn't working correctly - it will tell you exactly what rosparameters are missing.

Features:

  • Outputs all loaded data into consule using ROS_DEBUG, so you won't see it unless you turn it on
  • Namespaces all output within the parent_name
  • Great for having each class have its own parameter namespace
  • Helpful error messages if parameter is missing, explaining where it expects to find it
  • Removes lots of repetitious code
  • Supports datatypes that rosparam does not by default, such as std::size_t, ros::Duration, Eigen::Isometry3d, Eigen::Affine3d (deprecated)
  • Supports loading std::vectors easily, and debugging that data
  • Supports loading an entire list of bool parameters

This open source project was developed at PickNik Robotics. Need professional ROS development and consulting? Contact us at [email protected] for a free consultation.

Status:

  • Build Status Travis - Continuous Integration (Melodic)
  • Build Status Travis - Continuous Integration (Kinetic)
  • Build Status ROS Buildfarm - Bionic - Melodic Devel - Source Build
  • Build Status ROS Buildfarm - AMD64 Bionic - Melodic Devel - Debian Build
  • Build Status ROS Buildfarm - Xenial - Kinetic Devel - Source Build
  • Build Status ROS Buildfarm - AMD64 Xenial - Kinetic Devel - Debian Build

Install

Ubuntu Debian

rosparam_shortcuts is currently only released for ROS Kinetic and Melodic. For other ROS releases, you may need to build rosparam_shortcuts from source.

sudo apt-get install ros-$ROS_DISTRO-rosparam-shortcuts

Build from Source

To build this package, git clone this repo into a catkin workspace and be sure to install necessary dependencies by running the following command in the root of your catkin workspace:

rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

Code API

See Class Reference

Usage / Demo

See the file src/example.cpp for example code. To run:

roslaunch rosparam_shortcuts example.launch

Your yaml file would look something like the file config/example.yaml:

example:
  control_rate: 100.0 # double
  param1: 20 # int
  param2: 30 # size_t
  param3: 1 # ros::Duration
  param4: [1, 1, 1, 3.14, 0, 0] # Eigen::Isometry3d - x, y, z, roll, pitch, yaw
  param5: [1.1, 2.2, 3.3, 4.4] # std::vector<double>
  param6: [2, 2, 2, 1, 0, 0, 0] # Eigen::Isometry3d - x, y, z, qw, qx, qy, qz
  param7: [1, 1, 1, 3.14, 0, 0] # geometry_msgs::Pose - x, y, z, roll, pitch, yaw
  param8: [2, 2, 2, 1, 0, 0, 0] # geometry_msgs::Pose - x, y, z, qw, qx, qy, qz

Testing and Linting

To run roslint, use the following command with catkin-tools:

catkin build --no-status --no-deps --this --make-args roslint

To run catkin lint, use the following command with catkin-tools:

catkin lint -W2

There are currently no unit or integration tests for this package. If there were you would use the following command with catkin-tools:

catkin run_tests --no-deps --this -i

Contribute

Please send PRs for new helper functions, fixes, etc!

rosparam_shortcuts's People

Contributors

clalancette avatar davetcoleman avatar gavanderhoorn avatar henningkayser avatar jafarabdi avatar mlautman avatar v4hn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.