Core deterministic simulation runtime.
This package defines the rslcpp::Job interface and the simulation loop rslcpp::run_job(...).
rslcpp::Job: a small interface to describe what to run and how time advances.rslcpp::run_job(argc, argv, job): runs your job until finished and returns an exit code.- Per-tick simulation time update for each node’s ROS clock.
- Header:
include/rslcpp/rslcpp.hppclass rslcpp::Job(withJob::SharedPtrandJob::UniquePtrtypedefs)rslcpp::exit_code_t rslcpp::run_job(int argc, char ** argv, Job::SharedPtr job)
Your implementation provides:
create_and_get_nodes(): create all nodes and return them.get_initial_time(): initial simulation time (rclcpp::Time).get_finished(): when to stop.get_exit_code(): exit code returned after the loop.
A typical integration looks like:
#include <rslcpp/rslcpp.hpp>
class MyJob : public rslcpp::Job {
public:
std::vector<rclcpp::Node::SharedPtr> create_and_get_nodes() override;
rclcpp::Time get_initial_time() override;
bool get_finished() override;
rslcpp::exit_code_t get_exit_code() override;
};
int main(int argc, char ** argv)
{
auto job = std::make_shared<MyJob>();
return rslcpp::run_job(argc, argv, job);
}For complete examples, see rslcpp_test/executables/.
- All nodes must have
use_sim_timeenabled.rslcpp::run_jobchecks this at startup and throws if a node does not use sim time.
- Intended usage is a single-process simulation with intra-process communication enabled.
rslcpp_dynamic_job: ready-made job executable that dynamically loads composable nodesrslcpp_time_delay+rslcpp_time_delay_backend: per-topic message delay configurationrslcpp_helper_nodes: monitor / rosbag player / rosbag recorder helper nodes