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

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

No version for distro jazzy showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

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

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

No version for distro rolling showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

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

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

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

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

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

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange

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

Package Summary

Tags No category tags.
Version 0.1.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Package for creating various instances of performance tests

Additional Links

No additional links.

Maintainers

  • Alberto Soragna

Authors

  • Alberto Soragna

Performance Test Factory

This package contains a factory for creating multiple instances of performance_test::PerformanceNode with entities of various types.

This package depends on a series of plugin, defined by the group tag performance_test_factory_plugins. Each plugin will define some custom interfaces that can be used in the factory.

The simplest way of using the factory, consists in creating a json file describing the topology of a ROS2 process. Then this file can be parsed at runtime by the factory in order to create a system.

How to create a json topology and factory plugins

Run a system from a topology json file

#include "rclcpp/rclcpp.hpp"
#include "performance_test/performance_node_base.hpp"
#include "performance_test/system.hpp"
#include "performance_test_factory/factory.hpp"

rclcpp::init(argc, argv);

performance_test::System ros2_system();
performance_test_factory::TemplateFactory factory();

auto nodes_vec = factory.parse_topology_from_json("path_to_my_topology.json");
ros2_system.add_nodes(nodes_vec);

ros2_system.spin(std::chrono::seconds(10));

rclcpp::shutdown();

A complete example can be found in the simple architecture example.

Manually create ROS2 nodes

The performance_test_factory::TemplateFactory allows also to directly use strings for creating nodes, instead of parsing them from the json files.

#include "performance_test/performance_node_base.hpp"
#include "performance_test_factory/factory.hpp"


performance_test_factory::TemplateFactory factory();
bool use_ipc = true;
auto sub_node = factory.create_node("sub_node_name", use_ipc);
std::string msg_type = "stamped10kb";
std::string topic_name = "my_topic";
factory.add_subscriber_from_strings(sub_node, msg_type, topic_name, rclcpp::SensorDataQoS());

You can also create many similar nodes all at once. The names of all nodes, topics and services are substituted, for convenience, with numeric IDs.

The following snippet of code will create a system with 10 subscriber nodes, with names ranging from node_0 to node_9, and 2 publisher nodes, with names node_10 and node_11 and respectively publishing on topic_10 and topic_11. Each subscriber node will subscribe to both topics. Nodes are stored into vectors of shared pointers. Then remember to add the nodes to the performance_test::System in order to run them.

#include "performance_test_factory/factory.hpp"
#include "performance_test/performance_node.hpp"
#include "performance_test/system.hpp"

performance_test_factory::TemplateFactory factory;

int n_publishers = 2;
int n_subscribers = 10;
float frequency = 10;
std::string msg_type = "stamped10kb";

std::vector<std::shared_ptr<performance_test::PerformanceNode>> pub_nodes =
     factory.create_periodic_publisher_nodes(
          n_subscribers,
          n_subscribers + n_publishers,
          frequency,
          msg_type);

ros2_system.add_nodes(pub_nodes);

std::vector<std::shared_ptr<performance_test::PerformanceNode>> sub_nodes =
     factory.create_subscriber_nodes(
          0,
          n_subscribers,
          n_publishers,
          msg_type);

auto experiment_duration_sec = std::chrono::seconds(10);
System ros2_system();

ros2_system.add_nodes(pub_nodes);
ros2_system.add_nodes(sub_nodes);
ros2_system.spin(experiment_duration_sec);

NOTE: At the moment, these factory methods for creating subscribers and clients in a node will create all the possible ones, according to the specified number of publishers/servers. This means that using these methods, if there are 2 publishers they will publish on 2 different topics and every subscriber node will subscribe to all the available topics. It is not possible to use the TemplateFactory::create_subscriber_nodes and TemplateFactory::create_periodic_publisher_nodes methods for creating different topologies. If this is needed, it’s better to directly use the json files.

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 performance_test_factory at Robotics Stack Exchange