-
 

Package Summary

Tags No category tags.
Version 0.3.8
License BSD-3-Clause
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/PickNikRobotics/generate_parameter_library.git
VCS Type git
VCS Version main
Last Updated 2024-09-28
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Example usage of generate_parameter_library.

Additional Links

No additional links.

Maintainers

  • Paul Gesel

Authors

  • Paul Gesel

Example:

Build the node

 mkdir colcon_ws
 mkdir colcon_ws/src
 cd colcon_ws/src
 git clone https://github.com/picknikrobotics/generate_parameter_library.git
 cd ..
 colcon build

Run the C++ node

source install/setup.bash
ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/implementation.yaml

You should see an output like this: [INFO] [1656018676.015816509] [admittance_controller]: Control frame is: 'ee_link'

ROS 2 CLI

Run the following:

ros2 param list

You should see:

/admittance_controller:
  admittance.damping_ratio
  admittance.mass
  admittance.selected_axes
  admittance.stiffness
  chainable_command_interfaces
  command_interfaces
  control.frame.external
  control.frame.id
  enable_parameter_update_without_reactivation
  fixed_array
  fixed_string
  fixed_string_no_default
  fixed_world_frame.frame.external
  fixed_world_frame.frame.id
  ft_sensor.filter_coefficient
  ft_sensor.frame.external
  ft_sensor.frame.id
  ft_sensor.name
  gravity_compensation.CoG.force
  gravity_compensation.CoG.pos
  gravity_compensation.frame.external
  gravity_compensation.frame.id
  interpolation_mode
  joints
  kinematics.alpha
  kinematics.base
  kinematics.group_name
  kinematics.plugin_name
  kinematics.plugin_package
  kinematics.tip
  one_number
  pid.elbow_joint.d
  pid.elbow_joint.i
  pid.elbow_joint.p
  pid.rate
  pid.shoulder_lift_joint.d
  pid.shoulder_lift_joint.i
  pid.shoulder_lift_joint.p
  pid.shoulder_pan_joint.d
  pid.shoulder_pan_joint.i
  pid.shoulder_pan_joint.p
  pid.wrist_1_joint.d
  pid.wrist_1_joint.i
  pid.wrist_1_joint.p
  pid.wrist_2_joint.d
  pid.wrist_2_joint.i
  pid.wrist_2_joint.p
  pid.wrist_3_joint.d
  pid.wrist_3_joint.i
  pid.wrist_3_joint.p
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  scientific_notation_num
  state_interfaces
  three_numbers
  three_numbers_of_five
  use_feedforward_commanded_input
  use_sim_time
  

All parameter are automatically declared and callbacks are setup by default. You can set a parameter by typing:

ros2 param set /admittance_controller control.frame.id new_frame

You should see:

[INFO] [1656019001.515820371] [admittance_controller]: New control frame parameter is: 'new_frame'

Congratulations, you updated the parameter!

If you try to set a parameter that is read only, you will get an error. Running the following

ros2 param set /admittance_controller command_interfaces ["velocity"]

will result in the error

Setting parameter failed: parameter 'command_interfaces' cannot be set because it is read-only

Running the following

ros2 param describe /admittance_controller admittance.damping_ratio

will show a parameter’s description

 Parameter name: admittance.damping_ratio
  Type: double array
  Description: specifies damping ratio values for x, y, z, rx, ry, and rz used in the admittance calculation. The values are calculated as damping can be used instead: zeta = D / (2 * sqrt( M * S ))
  Constraints:
    Min value: 0.1
    Max value: 10.0

If you try to set a value out of the specified bounds,

ros2 param set /admittance_controller admittance.damping_ratio [-10.0,-10.0,-10.0,-10.0,-10.0,-10.0]

you will get the error

Setting parameter failed: Value -10.0 in parameter 'admittance.damping_ratio' must be within bounds [0.1, 10.0]

If you try to set a vector parameter with the wrong length,

ros2 param set /admittance_controller admittance.damping_ratio [1.0,1.0,1.0]

you will get the error

Setting parameter failed: Length of parameter 'admittance.damping_ratio' is 3 but must be equal to 6

If you try to load a yaml file with missing required parameters

ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/missing_required.yaml

you will get the error

terminate called after throwing an instance of 'rclcpp::exceptions::ParameterUninitializedException'
  what():  parameter 'fixed_string_no_default' is not initialized
[ros2run]: Aborted

CHANGELOG

Changelog for package generate_parameter_library_example

0.3.8 (2024-03-27)

  • Restore functionality for mapped params with no struct name ([#185 <https://github.com/PickNikRobotics/generate_parameter_library/issues/185>_]{.title-ref})
  • Fix newline issue (#176)
    • fix new line rendering for Python
  • Support nested mapped parameters (#166)
  • Contributors: Paul Gesel, Sebastian Castro

0.3.7 (2024-01-12)

  • Split example/README.md into C++ and Python version; updated content (#138)
  • Contributors: chriseichmann

0.3.6 (2023-07-31)

0.3.5 (2023-07-28)

  • Remove documentation of deprecated validator functions (#135)
  • Contributors: Tyler Weaver

0.3.4 (2023-07-24)

  • Add Python support for generate_parameter_library (#110) Co-authored-by: Tyler Weaver <<tyler@picknik.ai>>
  • Contributors: Paul Gesel

0.3.3 (2023-04-13)

0.3.2 (2023-04-12)

  • Populate Range Constraints in Parameter Descriptors from Validation Functions (#103)
  • Mark deprecated rsl method and propose alternative in the docs. (#102)
  • Contributors: Chance Cardona, Dr. Denis

0.3.1 (2023-02-01)

  • Make it easy for users to override (#92)
  • Contributors: Tyler Weaver

0.3.0 (2022-11-15)

  • Migrate from parameter_traits to RSL (take 2) (#91)
  • Contributors: Tyler Weaver

0.2.8 (2022-11-03)

0.2.7 (2022-10-28)

  • Standardize cmake (#79)
  • Contributors: Tyler Weaver

0.2.6 (2022-09-28)

0.2.5 (2022-09-20)

  • 🈵 Support use of '_' in mapped parameters. (#68)
  • Component node example (#60)
  • Update README for example (#63)
  • 🚀 Add cmake macros for using tests with example yaml files. 🤖 (#57) Co-authored-by: Tyler Weaver <<maybe@tylerjw.dev>>
  • Fix example parameters (#54)
  • Contributors: Denis Štogl, Paul Gesel, Tyler Weaver

0.2.4 (2022-08-19)

  • INTEGER type (#53)
  • 0.2.3
  • Contributors: Tyler Weaver

0.2.3 (2022-08-05)

0.2.2 (2022-08-03)

0.2.1 (2022-08-02)

  • Fix scientific notation (#46)
  • Contributors: Paul Gesel

0.2.0 (2022-08-01)

  • Create stack allocated struct (#45)
  • Fixed length arrays (#44)
  • Fixed size string no default bug (#43)
  • static OK to fix ODR errors (#41)
  • Change package name (#40)
  • parameter validators interface library (#32)
  • Validate fixed length Strings (#33)
  • Fixed size strings (#29)
  • Contributors: Paul Gesel, Tyler Weaver

0.1.0 (2022-07-27)

  • Example usage of generate_parameter_library.
  • Contributors: Paul Gesel, Tyler Weaver

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged generate_parameter_library_example at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 0.3.8
License BSD-3-Clause
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/PickNikRobotics/generate_parameter_library.git
VCS Type git
VCS Version main
Last Updated 2024-09-28
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Example usage of generate_parameter_library.

Additional Links

No additional links.

Maintainers

  • Paul Gesel

Authors

  • Paul Gesel

Example:

Build the node

 mkdir colcon_ws
 mkdir colcon_ws/src
 cd colcon_ws/src
 git clone https://github.com/picknikrobotics/generate_parameter_library.git
 cd ..
 colcon build

Run the C++ node

source install/setup.bash
ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/implementation.yaml

You should see an output like this: [INFO] [1656018676.015816509] [admittance_controller]: Control frame is: 'ee_link'

ROS 2 CLI

Run the following:

ros2 param list

You should see:

/admittance_controller:
  admittance.damping_ratio
  admittance.mass
  admittance.selected_axes
  admittance.stiffness
  chainable_command_interfaces
  command_interfaces
  control.frame.external
  control.frame.id
  enable_parameter_update_without_reactivation
  fixed_array
  fixed_string
  fixed_string_no_default
  fixed_world_frame.frame.external
  fixed_world_frame.frame.id
  ft_sensor.filter_coefficient
  ft_sensor.frame.external
  ft_sensor.frame.id
  ft_sensor.name
  gravity_compensation.CoG.force
  gravity_compensation.CoG.pos
  gravity_compensation.frame.external
  gravity_compensation.frame.id
  interpolation_mode
  joints
  kinematics.alpha
  kinematics.base
  kinematics.group_name
  kinematics.plugin_name
  kinematics.plugin_package
  kinematics.tip
  one_number
  pid.elbow_joint.d
  pid.elbow_joint.i
  pid.elbow_joint.p
  pid.rate
  pid.shoulder_lift_joint.d
  pid.shoulder_lift_joint.i
  pid.shoulder_lift_joint.p
  pid.shoulder_pan_joint.d
  pid.shoulder_pan_joint.i
  pid.shoulder_pan_joint.p
  pid.wrist_1_joint.d
  pid.wrist_1_joint.i
  pid.wrist_1_joint.p
  pid.wrist_2_joint.d
  pid.wrist_2_joint.i
  pid.wrist_2_joint.p
  pid.wrist_3_joint.d
  pid.wrist_3_joint.i
  pid.wrist_3_joint.p
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  scientific_notation_num
  state_interfaces
  three_numbers
  three_numbers_of_five
  use_feedforward_commanded_input
  use_sim_time
  

All parameter are automatically declared and callbacks are setup by default. You can set a parameter by typing:

ros2 param set /admittance_controller control.frame.id new_frame

You should see:

[INFO] [1656019001.515820371] [admittance_controller]: New control frame parameter is: 'new_frame'

Congratulations, you updated the parameter!

If you try to set a parameter that is read only, you will get an error. Running the following

ros2 param set /admittance_controller command_interfaces ["velocity"]

will result in the error

Setting parameter failed: parameter 'command_interfaces' cannot be set because it is read-only

Running the following

ros2 param describe /admittance_controller admittance.damping_ratio

will show a parameter’s description

 Parameter name: admittance.damping_ratio
  Type: double array
  Description: specifies damping ratio values for x, y, z, rx, ry, and rz used in the admittance calculation. The values are calculated as damping can be used instead: zeta = D / (2 * sqrt( M * S ))
  Constraints:
    Min value: 0.1
    Max value: 10.0

If you try to set a value out of the specified bounds,

ros2 param set /admittance_controller admittance.damping_ratio [-10.0,-10.0,-10.0,-10.0,-10.0,-10.0]

you will get the error

Setting parameter failed: Value -10.0 in parameter 'admittance.damping_ratio' must be within bounds [0.1, 10.0]

If you try to set a vector parameter with the wrong length,

ros2 param set /admittance_controller admittance.damping_ratio [1.0,1.0,1.0]

you will get the error

Setting parameter failed: Length of parameter 'admittance.damping_ratio' is 3 but must be equal to 6

If you try to load a yaml file with missing required parameters

ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/missing_required.yaml

you will get the error

terminate called after throwing an instance of 'rclcpp::exceptions::ParameterUninitializedException'
  what():  parameter 'fixed_string_no_default' is not initialized
[ros2run]: Aborted

CHANGELOG

Changelog for package generate_parameter_library_example

0.3.8 (2024-03-27)

  • Restore functionality for mapped params with no struct name ([#185 <https://github.com/PickNikRobotics/generate_parameter_library/issues/185>_]{.title-ref})
  • Fix newline issue (#176)
    • fix new line rendering for Python
  • Support nested mapped parameters (#166)
  • Contributors: Paul Gesel, Sebastian Castro

0.3.7 (2024-01-12)

  • Split example/README.md into C++ and Python version; updated content (#138)
  • Contributors: chriseichmann

0.3.6 (2023-07-31)

0.3.5 (2023-07-28)

  • Remove documentation of deprecated validator functions (#135)
  • Contributors: Tyler Weaver

0.3.4 (2023-07-24)

  • Add Python support for generate_parameter_library (#110) Co-authored-by: Tyler Weaver <<tyler@picknik.ai>>
  • Contributors: Paul Gesel

0.3.3 (2023-04-13)

0.3.2 (2023-04-12)

  • Populate Range Constraints in Parameter Descriptors from Validation Functions (#103)
  • Mark deprecated rsl method and propose alternative in the docs. (#102)
  • Contributors: Chance Cardona, Dr. Denis

0.3.1 (2023-02-01)

  • Make it easy for users to override (#92)
  • Contributors: Tyler Weaver

0.3.0 (2022-11-15)

  • Migrate from parameter_traits to RSL (take 2) (#91)
  • Contributors: Tyler Weaver

0.2.8 (2022-11-03)

0.2.7 (2022-10-28)

  • Standardize cmake (#79)
  • Contributors: Tyler Weaver

0.2.6 (2022-09-28)

0.2.5 (2022-09-20)

  • 🈵 Support use of '_' in mapped parameters. (#68)
  • Component node example (#60)
  • Update README for example (#63)
  • 🚀 Add cmake macros for using tests with example yaml files. 🤖 (#57) Co-authored-by: Tyler Weaver <<maybe@tylerjw.dev>>
  • Fix example parameters (#54)
  • Contributors: Denis Štogl, Paul Gesel, Tyler Weaver

0.2.4 (2022-08-19)

  • INTEGER type (#53)
  • 0.2.3
  • Contributors: Tyler Weaver

0.2.3 (2022-08-05)

0.2.2 (2022-08-03)

0.2.1 (2022-08-02)

  • Fix scientific notation (#46)
  • Contributors: Paul Gesel

0.2.0 (2022-08-01)

  • Create stack allocated struct (#45)
  • Fixed length arrays (#44)
  • Fixed size string no default bug (#43)
  • static OK to fix ODR errors (#41)
  • Change package name (#40)
  • parameter validators interface library (#32)
  • Validate fixed length Strings (#33)
  • Fixed size strings (#29)
  • Contributors: Paul Gesel, Tyler Weaver

0.1.0 (2022-07-27)

  • Example usage of generate_parameter_library.
  • Contributors: Paul Gesel, Tyler Weaver

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged generate_parameter_library_example at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 0.3.8
License BSD-3-Clause
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/PickNikRobotics/generate_parameter_library.git
VCS Type git
VCS Version main
Last Updated 2024-09-28
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Example usage of generate_parameter_library.

Additional Links

No additional links.

Maintainers

  • Paul Gesel

Authors

  • Paul Gesel

Example:

Build the node

 mkdir colcon_ws
 mkdir colcon_ws/src
 cd colcon_ws/src
 git clone https://github.com/picknikrobotics/generate_parameter_library.git
 cd ..
 colcon build

Run the C++ node

source install/setup.bash
ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/implementation.yaml

You should see an output like this: [INFO] [1656018676.015816509] [admittance_controller]: Control frame is: 'ee_link'

ROS 2 CLI

Run the following:

ros2 param list

You should see:

/admittance_controller:
  admittance.damping_ratio
  admittance.mass
  admittance.selected_axes
  admittance.stiffness
  chainable_command_interfaces
  command_interfaces
  control.frame.external
  control.frame.id
  enable_parameter_update_without_reactivation
  fixed_array
  fixed_string
  fixed_string_no_default
  fixed_world_frame.frame.external
  fixed_world_frame.frame.id
  ft_sensor.filter_coefficient
  ft_sensor.frame.external
  ft_sensor.frame.id
  ft_sensor.name
  gravity_compensation.CoG.force
  gravity_compensation.CoG.pos
  gravity_compensation.frame.external
  gravity_compensation.frame.id
  interpolation_mode
  joints
  kinematics.alpha
  kinematics.base
  kinematics.group_name
  kinematics.plugin_name
  kinematics.plugin_package
  kinematics.tip
  one_number
  pid.elbow_joint.d
  pid.elbow_joint.i
  pid.elbow_joint.p
  pid.rate
  pid.shoulder_lift_joint.d
  pid.shoulder_lift_joint.i
  pid.shoulder_lift_joint.p
  pid.shoulder_pan_joint.d
  pid.shoulder_pan_joint.i
  pid.shoulder_pan_joint.p
  pid.wrist_1_joint.d
  pid.wrist_1_joint.i
  pid.wrist_1_joint.p
  pid.wrist_2_joint.d
  pid.wrist_2_joint.i
  pid.wrist_2_joint.p
  pid.wrist_3_joint.d
  pid.wrist_3_joint.i
  pid.wrist_3_joint.p
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  scientific_notation_num
  state_interfaces
  three_numbers
  three_numbers_of_five
  use_feedforward_commanded_input
  use_sim_time
  

All parameter are automatically declared and callbacks are setup by default. You can set a parameter by typing:

ros2 param set /admittance_controller control.frame.id new_frame

You should see:

[INFO] [1656019001.515820371] [admittance_controller]: New control frame parameter is: 'new_frame'

Congratulations, you updated the parameter!

If you try to set a parameter that is read only, you will get an error. Running the following

ros2 param set /admittance_controller command_interfaces ["velocity"]

will result in the error

Setting parameter failed: parameter 'command_interfaces' cannot be set because it is read-only

Running the following

ros2 param describe /admittance_controller admittance.damping_ratio

will show a parameter’s description

 Parameter name: admittance.damping_ratio
  Type: double array
  Description: specifies damping ratio values for x, y, z, rx, ry, and rz used in the admittance calculation. The values are calculated as damping can be used instead: zeta = D / (2 * sqrt( M * S ))
  Constraints:
    Min value: 0.1
    Max value: 10.0

If you try to set a value out of the specified bounds,

ros2 param set /admittance_controller admittance.damping_ratio [-10.0,-10.0,-10.0,-10.0,-10.0,-10.0]

you will get the error

Setting parameter failed: Value -10.0 in parameter 'admittance.damping_ratio' must be within bounds [0.1, 10.0]

If you try to set a vector parameter with the wrong length,

ros2 param set /admittance_controller admittance.damping_ratio [1.0,1.0,1.0]

you will get the error

Setting parameter failed: Length of parameter 'admittance.damping_ratio' is 3 but must be equal to 6

If you try to load a yaml file with missing required parameters

ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/missing_required.yaml

you will get the error

terminate called after throwing an instance of 'rclcpp::exceptions::ParameterUninitializedException'
  what():  parameter 'fixed_string_no_default' is not initialized
[ros2run]: Aborted

CHANGELOG

Changelog for package generate_parameter_library_example

0.3.8 (2024-03-27)

  • Restore functionality for mapped params with no struct name ([#185 <https://github.com/PickNikRobotics/generate_parameter_library/issues/185>_]{.title-ref})
  • Fix newline issue (#176)
    • fix new line rendering for Python
  • Support nested mapped parameters (#166)
  • Contributors: Paul Gesel, Sebastian Castro

0.3.7 (2024-01-12)

  • Split example/README.md into C++ and Python version; updated content (#138)
  • Contributors: chriseichmann

0.3.6 (2023-07-31)

0.3.5 (2023-07-28)

  • Remove documentation of deprecated validator functions (#135)
  • Contributors: Tyler Weaver

0.3.4 (2023-07-24)

  • Add Python support for generate_parameter_library (#110) Co-authored-by: Tyler Weaver <<tyler@picknik.ai>>
  • Contributors: Paul Gesel

0.3.3 (2023-04-13)

0.3.2 (2023-04-12)

  • Populate Range Constraints in Parameter Descriptors from Validation Functions (#103)
  • Mark deprecated rsl method and propose alternative in the docs. (#102)
  • Contributors: Chance Cardona, Dr. Denis

0.3.1 (2023-02-01)

  • Make it easy for users to override (#92)
  • Contributors: Tyler Weaver

0.3.0 (2022-11-15)

  • Migrate from parameter_traits to RSL (take 2) (#91)
  • Contributors: Tyler Weaver

0.2.8 (2022-11-03)

0.2.7 (2022-10-28)

  • Standardize cmake (#79)
  • Contributors: Tyler Weaver

0.2.6 (2022-09-28)

0.2.5 (2022-09-20)

  • 🈵 Support use of '_' in mapped parameters. (#68)
  • Component node example (#60)
  • Update README for example (#63)
  • 🚀 Add cmake macros for using tests with example yaml files. 🤖 (#57) Co-authored-by: Tyler Weaver <<maybe@tylerjw.dev>>
  • Fix example parameters (#54)
  • Contributors: Denis Štogl, Paul Gesel, Tyler Weaver

0.2.4 (2022-08-19)

  • INTEGER type (#53)
  • 0.2.3
  • Contributors: Tyler Weaver

0.2.3 (2022-08-05)

0.2.2 (2022-08-03)

0.2.1 (2022-08-02)

  • Fix scientific notation (#46)
  • Contributors: Paul Gesel

0.2.0 (2022-08-01)

  • Create stack allocated struct (#45)
  • Fixed length arrays (#44)
  • Fixed size string no default bug (#43)
  • static OK to fix ODR errors (#41)
  • Change package name (#40)
  • parameter validators interface library (#32)
  • Validate fixed length Strings (#33)
  • Fixed size strings (#29)
  • Contributors: Paul Gesel, Tyler Weaver

0.1.0 (2022-07-27)

  • Example usage of generate_parameter_library.
  • Contributors: Paul Gesel, Tyler Weaver

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged generate_parameter_library_example at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 0.3.8
License BSD-3-Clause
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/PickNikRobotics/generate_parameter_library.git
VCS Type git
VCS Version main
Last Updated 2024-09-28
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Example usage of generate_parameter_library.

Additional Links

No additional links.

Maintainers

  • Paul Gesel

Authors

  • Paul Gesel

Example:

Build the node

 mkdir colcon_ws
 mkdir colcon_ws/src
 cd colcon_ws/src
 git clone https://github.com/picknikrobotics/generate_parameter_library.git
 cd ..
 colcon build

Run the C++ node

source install/setup.bash
ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/implementation.yaml

You should see an output like this: [INFO] [1656018676.015816509] [admittance_controller]: Control frame is: 'ee_link'

ROS 2 CLI

Run the following:

ros2 param list

You should see:

/admittance_controller:
  admittance.damping_ratio
  admittance.mass
  admittance.selected_axes
  admittance.stiffness
  chainable_command_interfaces
  command_interfaces
  control.frame.external
  control.frame.id
  enable_parameter_update_without_reactivation
  fixed_array
  fixed_string
  fixed_string_no_default
  fixed_world_frame.frame.external
  fixed_world_frame.frame.id
  ft_sensor.filter_coefficient
  ft_sensor.frame.external
  ft_sensor.frame.id
  ft_sensor.name
  gravity_compensation.CoG.force
  gravity_compensation.CoG.pos
  gravity_compensation.frame.external
  gravity_compensation.frame.id
  interpolation_mode
  joints
  kinematics.alpha
  kinematics.base
  kinematics.group_name
  kinematics.plugin_name
  kinematics.plugin_package
  kinematics.tip
  one_number
  pid.elbow_joint.d
  pid.elbow_joint.i
  pid.elbow_joint.p
  pid.rate
  pid.shoulder_lift_joint.d
  pid.shoulder_lift_joint.i
  pid.shoulder_lift_joint.p
  pid.shoulder_pan_joint.d
  pid.shoulder_pan_joint.i
  pid.shoulder_pan_joint.p
  pid.wrist_1_joint.d
  pid.wrist_1_joint.i
  pid.wrist_1_joint.p
  pid.wrist_2_joint.d
  pid.wrist_2_joint.i
  pid.wrist_2_joint.p
  pid.wrist_3_joint.d
  pid.wrist_3_joint.i
  pid.wrist_3_joint.p
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  scientific_notation_num
  state_interfaces
  three_numbers
  three_numbers_of_five
  use_feedforward_commanded_input
  use_sim_time
  

All parameter are automatically declared and callbacks are setup by default. You can set a parameter by typing:

ros2 param set /admittance_controller control.frame.id new_frame

You should see:

[INFO] [1656019001.515820371] [admittance_controller]: New control frame parameter is: 'new_frame'

Congratulations, you updated the parameter!

If you try to set a parameter that is read only, you will get an error. Running the following

ros2 param set /admittance_controller command_interfaces ["velocity"]

will result in the error

Setting parameter failed: parameter 'command_interfaces' cannot be set because it is read-only

Running the following

ros2 param describe /admittance_controller admittance.damping_ratio

will show a parameter’s description

 Parameter name: admittance.damping_ratio
  Type: double array
  Description: specifies damping ratio values for x, y, z, rx, ry, and rz used in the admittance calculation. The values are calculated as damping can be used instead: zeta = D / (2 * sqrt( M * S ))
  Constraints:
    Min value: 0.1
    Max value: 10.0

If you try to set a value out of the specified bounds,

ros2 param set /admittance_controller admittance.damping_ratio [-10.0,-10.0,-10.0,-10.0,-10.0,-10.0]

you will get the error

Setting parameter failed: Value -10.0 in parameter 'admittance.damping_ratio' must be within bounds [0.1, 10.0]

If you try to set a vector parameter with the wrong length,

ros2 param set /admittance_controller admittance.damping_ratio [1.0,1.0,1.0]

you will get the error

Setting parameter failed: Length of parameter 'admittance.damping_ratio' is 3 but must be equal to 6

If you try to load a yaml file with missing required parameters

ros2 run generate_parameter_library_example test_node --ros-args --params-file src/generate_parameter_library/example/config/missing_required.yaml

you will get the error

terminate called after throwing an instance of 'rclcpp::exceptions::ParameterUninitializedException'
  what():  parameter 'fixed_string_no_default' is not initialized
[ros2run]: Aborted

CHANGELOG

Changelog for package generate_parameter_library_example

0.3.8 (2024-03-27)

  • Restore functionality for mapped params with no struct name ([#185 <https://github.com/PickNikRobotics/generate_parameter_library/issues/185>_]{.title-ref})
  • Fix newline issue (#176)
    • fix new line rendering for Python
  • Support nested mapped parameters (#166)
  • Contributors: Paul Gesel, Sebastian Castro

0.3.7 (2024-01-12)

  • Split example/README.md into C++ and Python version; updated content (#138)
  • Contributors: chriseichmann

0.3.6 (2023-07-31)

0.3.5 (2023-07-28)

  • Remove documentation of deprecated validator functions (#135)
  • Contributors: Tyler Weaver

0.3.4 (2023-07-24)

  • Add Python support for generate_parameter_library (#110) Co-authored-by: Tyler Weaver <<tyler@picknik.ai>>
  • Contributors: Paul Gesel

0.3.3 (2023-04-13)

0.3.2 (2023-04-12)

  • Populate Range Constraints in Parameter Descriptors from Validation Functions (#103)
  • Mark deprecated rsl method and propose alternative in the docs. (#102)
  • Contributors: Chance Cardona, Dr. Denis

0.3.1 (2023-02-01)

  • Make it easy for users to override (#92)
  • Contributors: Tyler Weaver

0.3.0 (2022-11-15)

  • Migrate from parameter_traits to RSL (take 2) (#91)
  • Contributors: Tyler Weaver

0.2.8 (2022-11-03)

0.2.7 (2022-10-28)

  • Standardize cmake (#79)
  • Contributors: Tyler Weaver

0.2.6 (2022-09-28)

0.2.5 (2022-09-20)

  • 🈵 Support use of '_' in mapped parameters. (#68)
  • Component node example (#60)
  • Update README for example (#63)
  • 🚀 Add cmake macros for using tests with example yaml files. 🤖 (#57) Co-authored-by: Tyler Weaver <<maybe@tylerjw.dev>>
  • Fix example parameters (#54)
  • Contributors: Denis Štogl, Paul Gesel, Tyler Weaver

0.2.4 (2022-08-19)

  • INTEGER type (#53)
  • 0.2.3
  • Contributors: Tyler Weaver

0.2.3 (2022-08-05)

0.2.2 (2022-08-03)

0.2.1 (2022-08-02)

  • Fix scientific notation (#46)
  • Contributors: Paul Gesel

0.2.0 (2022-08-01)

  • Create stack allocated struct (#45)
  • Fixed length arrays (#44)
  • Fixed size string no default bug (#43)
  • static OK to fix ODR errors (#41)
  • Change package name (#40)
  • parameter validators interface library (#32)
  • Validate fixed length Strings (#33)
  • Fixed size strings (#29)
  • Contributors: Paul Gesel, Tyler Weaver

0.1.0 (2022-07-27)

  • Example usage of generate_parameter_library.
  • Contributors: Paul Gesel, Tyler Weaver

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged generate_parameter_library_example at Robotics Stack Exchange

No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.