Add CLI args to Node constructor (#461)
* Add CLI args to Node constructor Adds arguments and use_global_arguments to NodeBase * Check for integer overflow
This commit is contained in:
parent
07e5be7621
commit
360f1b9425
9 changed files with 126 additions and 9 deletions
|
@ -88,6 +88,9 @@ public:
|
|||
* \param[in] node_name Name of the node.
|
||||
* \param[in] node_name Namespace of the node.
|
||||
* \param[in] context The context for the node (usually represents the state of a process).
|
||||
* \param[in] arguments Command line arguments that should apply only to this node.
|
||||
* This can be used to provide remapping rules that only affect one instance.
|
||||
* \param[in] use_global_arguments False to prevent node using arguments passed to the process.
|
||||
* \param[in] use_intra_process_comms True to use the optimized intra-process communication
|
||||
* pipeline to pass messages between nodes in the same process using shared memory.
|
||||
*/
|
||||
|
@ -96,6 +99,8 @@ public:
|
|||
const std::string & node_name,
|
||||
const std::string & namespace_,
|
||||
rclcpp::Context::SharedPtr context,
|
||||
const std::vector<std::string> & arguments,
|
||||
bool use_global_arguments = true,
|
||||
bool use_intra_process_comms = false);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
|
|
|
@ -49,6 +49,8 @@ LifecycleNode::LifecycleNode(
|
|||
node_name,
|
||||
namespace_,
|
||||
rclcpp::contexts::default_context::get_global_default_context(),
|
||||
{},
|
||||
true,
|
||||
use_intra_process_comms)
|
||||
{}
|
||||
|
||||
|
@ -56,8 +58,11 @@ LifecycleNode::LifecycleNode(
|
|||
const std::string & node_name,
|
||||
const std::string & namespace_,
|
||||
rclcpp::Context::SharedPtr context,
|
||||
const std::vector<std::string> & arguments,
|
||||
bool use_global_arguments,
|
||||
bool use_intra_process_comms)
|
||||
: node_base_(new rclcpp::node_interfaces::NodeBase(node_name, namespace_, context)),
|
||||
: node_base_(new rclcpp::node_interfaces::NodeBase(
|
||||
node_name, namespace_, context, arguments, use_global_arguments)),
|
||||
node_graph_(new rclcpp::node_interfaces::NodeGraph(node_base_.get())),
|
||||
node_logging_(new rclcpp::node_interfaces::NodeLogging(node_base_.get())),
|
||||
node_timers_(new rclcpp::node_interfaces::NodeTimers(node_base_.get())),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue