Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
jazzy

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro kilted showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
rolling

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro ardent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro bouncy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro crystal showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro eloquent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro dashing showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro foxy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro iron showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro lunar showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro jade showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro indigo showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro hydro showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro kinetic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

parameter_expression package from parameter_expression repo

parameter_expression

ROS Distro
humble

Package Summary

Tags No category tags.
Version 0.0.1
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ForteFibre/parameter_expression.git
VCS Type git
VCS Version main
Last Updated 2025-07-16
Dev Status DEVELOPED
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Using mathematical expression in ROS 2 parameter

Additional Links

No additional links.

Maintainers

  • f0reachARR

Authors

No additional authors.

parameter_expression

A ROS 2 package that allows using mathematical expressions in dynamic parameters using the muParser library.

Overview

The parameter_expression package provides a C++ class that enables ROS 2 nodes to use mathematical expressions as parameter values. Instead of static numeric values, you can use expressions like "sin(0.5) * 2 + 1" which will be evaluated dynamically when the parameter is set.

Features

  • Dynamic Expression Evaluation: Parameters can be set as mathematical expressions that are evaluated in real-time
  • Mathematical Functions: Supports common mathematical functions like sin, cos, tan, atan2, etc (powered by muParser).
  • Type Flexibility: Automatically handles different parameter types (int, double, string expressions)
  • Error Handling: Provides error messages for invalid expressions

Dependencies

  • rclcpp: ROS 2 C++ client library
  • muParser: Mathematical expression parser library

Usage

Basic Usage

Include the header in your ROS 2 node:

#include <parameter_expression/parameter_expression.hpp>

Also, ensure you have the necessary dependencies in your package.xml and CMakeLists.txt:

<depend>parameter_expression</depend>

find_package(parameter_expression REQUIRED)

target_link_libraries(
  your_node
  parameter_expression::parameter_expression
)

Create a parameter expression in your node:

class MyNode : public rclcpp::Node
{
public:
  MyNode() : Node("my_node")
  {
    // Create a parameter expression with default value 0.0
    expression_param_ = std::make_shared<parameter_expression::ParameterExpression>(*this, "my_expression", 0.0);
  }

  void some_function()
  {
    // Get the current evaluated value
    double value = expression_param_->get();
    RCLCPP_INFO(this->get_logger(), "Expression value: %f", value);
  }

private:
  parameter_expression::ParameterExpression::SharedPtr expression_param_;
};

Setting Parameters

You can set the parameter using various methods:

Via Command Line

ros2 param set /my_node my_expression "sin(3.14159/2) * 100"

Via Launch File or parameter YAML file

<launch>
  <node pkg="your_package" exec="your_node" name="my_node">
    <param name="my_expression" value="2 * _pi * 0.5" />
  </node>
</launch>

Advanced Usage

Custom Parameter Descriptor

rcl_interfaces::msg::ParameterDescriptor descriptor;
descriptor.description = "A mathematical expression for calculation";
descriptor.additional_constraints = "Must be a valid mathematical expression";

auto expression_param = std::make_shared<parameter_expression::ParameterExpression>(
  *this, "advanced_expression", 1.0, descriptor);

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged parameter_expression at Robotics Stack Exchange