Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [rclcpp]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
22 views

ROS2 rclcpp subscriber callback uses same shared_ptr for each new message

I have an rclcpp node with some message data coming in (images, scans, etc). I would like to apply temporal filtering to this data, and therefore store a copy of each incoming message. I assumed ...
edgex004's user avatar
0 votes
1 answer
16 views

Is there any way to directly pass a closure to the event loop of a node, bypassing the overhead of using a ros message

I'd like to do some work in a std::thread and then occasionally pass this data to the ROS thread for publishing or further processing. The only way I can see how ...
Adam's user avatar
  • 1
0 votes
0 answers
14 views

RCLCPP: rclcpp namespace used by default?

I have a "Node" class, used for pathfinding. However, when I try to use it anywhere in my rclcpp project, I get errors like "error: cannot convert ‘rclcpp::Node*’ to ‘Node*’". I ...
Matthew Gomes's user avatar
1 vote
1 answer
37 views

How to migrate ROS1 code that passes ros::Nodehandle to functions inside constructor

In ROS 1 C++ code, a somewhat popular idiom involves calling functions that takes ros::NodeHandle to initialize members, e.g. ...
Hs293Go's user avatar
  • 13
1 vote
1 answer
46 views

How to add an additional argument in a ROS2 cpp callback

I want to add an additional argument in a callback function for rclcpp, e.g. callback(msg, additional_argument). I can do it in ...
gab's user avatar
  • 113
0 votes
2 answers
85 views

rclcpp ROS2 params yaml file comments

Does anyone know, if there are available comments in the yaml files containing parameters? I tried to comment some information to keep it for later, but then I got rcl parsing exception. But maybe I ...
magladko's user avatar
0 votes
1 answer
108 views

Can’t see debug messages using RCLCPP_DEBUG

I can’t see messages using RCLCPP_DEBUG by terminal and rqt, but I can using other levels of verbosity( INFO, ERROR, FATAL…).Selecting debug in rqt to see those messages doesn’t work either. I’m using ...
pgarcia-dev's user avatar
0 votes
0 answers
20 views

When will subscriber status callbacks be available in ROS2?

What are the plans for implementing rclcpp subscriber status callbacks (connect/disconnect) in ROS2? I found this ROS1 feature quite handy. Note that this question has been asked before but since that ...
Bernd Pfrommer's user avatar
0 votes
1 answer
44 views

Nav2: Migrate from nav_msg::getPlan

I've been migrating to ROS Humble a ROS 1 exploration project in C++. This project considers a list of goal candidates and to evaluate them we use to call the service ...
joanvallve's user avatar
0 votes
0 answers
46 views

adjusting Timer period as it is in use, RCLCPP

I am using a rclcpp Timer, namely: rclcpp::TimerBase::SharedPtr timer = this->create_wall_timer(100m, std::bind(&MyTimerProg::timer_callback, this)); I would like to adjust the timer period as ...
Can Altineller's user avatar
0 votes
2 answers
76 views

Sending node object to a class inside the node

I have a class named UarmControl that inherits the Node class. Inside my UarmControl class, I want to send the node it self to another class named Uarm that I want to create inside my constructor. The ...
eidetech's user avatar
0 votes
0 answers
17 views

how many callback groups lifecycle nodes use by default and why?

I am checking number of callback groups in my lifecycle node using : this->get_node_base_interface()->get_callback_groups().size()); Before initialising any ...
tomRob's user avatar
  • 88
0 votes
1 answer
47 views

Lifecycle node consuming cpu in deactivated state

My node which is a critical component of a larger system contains the following interfaces for communicating with other nodes Two action servers One tf listner One service server Four subscribers Two ...
tomRob's user avatar
  • 88
0 votes
1 answer
46 views

How to declare parameter that are only known at runtime

I'm currently facing an issue with the ros2 parameters. I'm not sure how to approach this, from Iron on ros2_controller creates a node without the node options ...
saikishor's user avatar
0 votes
0 answers
23 views

Error when running RCLCPP examples on microROS workspace with rmw_microxrcedds

I am trying to build rclcpp publisher subscriber example on microROS (host workspace on ubuntu:jammy). I am able to compile it (with -DRMW_IMPLEMENTATION=rmw_microxrcedds) and run it for cyclonedds ...
Ace_Dalman's user avatar
0 votes
1 answer
45 views

Using ImageTransport in a constructor throws std::bad_weak_ptr

I am trying to create an ImageTransport instance to set up an image publisher which is a class member). I stick to this example, trying to adapt it to my class: <...
labude's user avatar
  • 11
0 votes
1 answer
69 views

rclcpp - float conversion warning when using `declare_parameter<float>`

Compiling a node with the following snippet and -Wfloat-conversion leads to the following: ...
Patrick Roncagliolo's user avatar
0 votes
0 answers
21 views

ros2 using cpp ament package library in another cpp ament package

i'm trying to transform ego-planner-swarm founded in: https://github.com/ZJU-FAST-Lab/ego-planner-swarm to ros2... in my ros2 workspace, i have 3 packages... bspline_opt(as library) plan_manage ...
arash mokhtari sherkat's user avatar
0 votes
2 answers
208 views

rclcpp::QoS error when running colcon build

I am trying to run ros2-canopen from VirtualBox in Ubuntu 22.04.03., the host is Windows11. I have installed ros2 following instructions from: https://docs.ros.org/en/humble/Installation/Ubuntu-...
user avatar
0 votes
1 answer
453 views

ROS2 multi-threaded executor timers block subscriber callbacks

Using RCLCPP, ROS2-Iron, Ubuntu 22.04. Using rclcpp::executors::MultiThreadedExecutor executor When defining callback groups, if I leave both timers and subscribers ...
Toby Buckley's user avatar
0 votes
1 answer
69 views

Is there a way to enumerate over predefined constants in ROS2 message definitions?

I'd like to know if there is a way to enumerate over the available constants defined in a message. As an example, let's take the visualization_msgs/Marker.msg as an ...
Steve's user avatar
  • 1
0 votes
3 answers
1k views

ros2 spinning problem[SOLVED]

i'm trying to transform ego-planner-swarm founded in: https://github.com/ZJU-FAST-Lab/ego-planner-swarm to ros2... the problem was in one of the subscription's callbacks there was a function in which ...
arash mokhtari sherkat's user avatar
0 votes
2 answers
117 views

Multiple servers in a single node [ROS2]

I am trying to make two servers for two different services in a single node. For example, like so: ...
Suchetan Saravanan's user avatar
0 votes
0 answers
69 views

undefined reference to many pkgs

I just started out with ROS 2.0. I am unsure if I am doing something stupid or missing out something. However, I can’t build these files. If I should have posted somewhere else kindly let me know. i'm ...
husten's user avatar
  • 1
1 vote
0 answers
335 views

error: no type named ‘type’ in ‘struct std::enable_if<false, void>’ when calling rclcpp::create_timer()

I am trying to convert a piece of code written in ROS1 to ROS2. I am having trouble with the following line, which instantiates a ros:::Timer object: in ROS1: ...
Natanel Birarov's user avatar
0 votes
0 answers
189 views

rclcpp::spin_until_future_complete(): Timeout for "non-blocking" call

tl;dr Expected behaviour: Having a non-blocking spin. Current behaviour: spin_until_future_complete() always returns timeout without firing any topic callback Hi, I am working on implementing the ...
magladko's user avatar
1 vote
0 answers
32 views

Pybind11 python bindings for Node

I'm currently creating python bindings for libhri, a ROS C++ library on Humble. The current C++ implementation (not public yet) takes a rclcpp::Node::SharedPtr argument to internally create topic ...
Luka Juricic's user avatar
0 votes
1 answer
52 views

How to stop the subscription to "/parameter_events" that is automatically created in each node

I have been able to stop the publisher to the topic (/parameter_events) by setting start_parameter_event_publisher in ...
user37234's user avatar
0 votes
1 answer
227 views

What is the difference between RCL_STEADY_TIME, RCL_SYSTEM_TIME and RCL_ROS_TIME?

I wrote the following code to check the difference myself, but I could not find any considerable difference. ...
RobotBramhana's user avatar
0 votes
0 answers
285 views

ROS2 rclcpp serialization : Cannot deserialize message of type geometry_msgs/msg/transform_stamped

I'm trying to plot the trajectory of a Crazyflie2 drone which is record on the /tf topic of a rosbag. I reused the code copied the code from this ROS2 tutorial (https://docs.ros.org/en/rolling/...
chade's user avatar
  • 1
0 votes
1 answer
84 views

exception thrown in rcl_logging_rosout_remove_sublogger on destruction with a child logger with static lifetime

I believe this is likely a bug. Here is a minimal example and the output with a stack trace (made with backwardcpp): ...
Tyler Weaver's user avatar
0 votes
0 answers
92 views

Example for using ROS2 Moveit2's asyncExecute()

I would like to use the asyncExecute() function offered by Moveit2 CPP API (ROS2 Humble), and then monitor the status of execution. I searched for a bit and only ...
Tejas Kumar's user avatar
0 votes
1 answer
189 views

rclcpp::Time epochs

I would like to get seconds, and nanoseconds from inside my node, so I have a timer_callback that executes each 100ms, to note seconds and nanoseconds of the rclcpp::Time ...
Can Altineller's user avatar
1 vote
0 answers
403 views

spin_until_future_complete in an already spinning node

I’m making a program, this program has a rclcpp::node and is running with several threads. In the main thread I have executor.add_node(node); executor.spin(); this ...
Donca's user avatar
  • 11
0 votes
1 answer
98 views

How can I call a member method which is inside a ROS2 node class?

I have a node class shown below and I want to call its setCloud method from another class but it gives me the error: error: ‘using element_type = class rclcpp::Node’ {aka ‘class rclcpp::Node’} has no ...
SEC's user avatar
  • 3
0 votes
1 answer
24 views

Getting current log directory in a CPP Node

I have a different process in my CPP node that writes a separate log file. Right now, this log is written to a file in ros2_ws/log/additional_process.log but I ...
moschmdt's user avatar
0 votes
1 answer
230 views

ROS2 CPP file only second logger

For a specific ROS2 (humble) node that I'm working on I want to add a second logger that just logs to a file (preferably its own). Setting up a second logger is straightforward, as one can just call <...
snoato's user avatar
  • 103
0 votes
0 answers
13 views

Recall global parameters: std::shared_future<std::vector<rclcpp::Parameter>>

I'm looking to retrive some global parameters (the name of my topics) from an yaml file that is shared by a global_parameter_server node. Now from another node I'm trying to recall these parameters.I'...
Donca's user avatar
  • 11
0 votes
1 answer
538 views

fatal error: rclcpp/rclcpp.hpp: No such file or directory

I already build some others packages without errors, but now i'm trying to build a library now and i have this error: fatal error: rclcpp/rclcpp.hpp: No such file or directory 10 | #include "...
Donca's user avatar
  • 11
3 votes
1 answer
865 views

Start and stop a node from another node with no system call (ROS2 CPP)

The issue I'm reporting is quite common looking at similar questions: Shutdown a node from another node in ROS CPP Start or stop the ROS node in another node Could a node can be stoped by another node?...
Antonio Bono's user avatar
0 votes
0 answers
61 views

How to handle cascaded service calls in ROS2 node integration tests with gtest (C++)

I want to write some integration tests for my ROS2 node (Humble) that provides an service which in turn calls a service. While during runtime this works perfectly fine, when I try to create a unit ...
Tijs van der Smagt's user avatar
0 votes
1 answer
658 views

ROS2 - Initialize rclcpp within a class (for tests)

I'm trying to write some tests for my package. Since there's the option of using fixtures, I planned on using those, but I came across this problem. I've created a test class like so ...
slim71's user avatar
  • 13
0 votes
1 answer
424 views

ament_target_dependencies not linking an upstream ament package?

Background Upstream pkg (called rclcpp_sample) provides a library-a. Downstream pkg (called rclcpp_child_sample) provides an executable that depends on library-a. Both are ...
IsaacS's user avatar
  • 4,502
0 votes
1 answer
34 views

Deprecating a ROS 2 parameter name

ros-perception/image_transport_plugins was ported across from ROS 1 to ROS 2 a while back. During the port, some parameters were given the wrong parameter name. We are trying to revert the parameter ...
ijnek's user avatar
  • 308
0 votes
1 answer
12 views

Dynamic TF Publishing Discrepancy Between Foxy and Humble

I have posted an issue on GitHub; however, no one responds to it. So I start to wonder if it is my own mistake. It begins from one day when I transform a piece of ROS foxy code into the Humble ...
user avatar
1 vote
1 answer
60 views

Is it possible to set up intra process communications b/w 1 publisher and multiple subscribers?

I was reading this tutorial: https://docs.ros.org/en/humble/Tutorials/Demos/Intra-Process-Communication.html Is it possible to have multiple subscribers to the published message? How does the unique ...
sisaha9's user avatar
  • 13
0 votes
2 answers
81 views

the same msg type of multiple topic names can use only one callback on ros2?

Hello, I have /camera_1, /camera_2, /camera_3 and ...
user avatar
2 votes
3 answers
2k views

VS Code C/C++ extension Issue with ros program header file

Recently, when I was trying to compile a ROS programm written in C++ (with C/C++ extension installed in VSCode) I ran in to a problem with the header files included in the program (...
Jishnu's user avatar
  • 201
3 votes
1 answer
1k views

How do you automate fixing formatting errors found by ament_cpplint?

I'm working on a PR for rclcpp, and when I run the tests, I get formatting errors about white space from cpplint. Is there any automated way to fix these? Here is an example: ...
Tyler Weaver's user avatar
0 votes
1 answer
168 views

error: no matching function for call to create_subscription

Hello, I'm trying to run orbslam2 on a tello drone using ros 2 (foxy distro, ubuntu 20.04). For the purpose, I am trying to use this repository: https://github.com/tentone/tello-ros2 What I managed to ...
user avatar