Skip to main content
3 votes

How do you automate fixing formatting errors found by ament_cpplint?

Recently, I've had some success running ament_uncrustify --reformat for fixing issues found by ament_cpplint, since these tools (...
Loy's user avatar
  • 105
3 votes
Accepted

ROS2 CPP file only second logger

Short answer: Re. separate log files: It is not currently possible to log to two separate files from one node. To realize this, you'd have to implement an alternative rcl_logging_interface. (Multiple ...
JRTG's user avatar
  • 2,074
3 votes

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

lifecycle nodes are the default solution for this. Activate your node when conditions are met, and deactivate it when it should not be active anymore. In your activate and deactivate transitions you ...
Tijs van der Smagt's user avatar
2 votes

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

Unfortunately I don't think it is possible to do this automatically given the way the IDL is defined. You'll notice in the marker message there are actually two sets of constants (one for markers, one ...
Andre Nguyen's user avatar
1 vote

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

Try adding the following to your CMakeLists.txt: ament_target_dependencies(TEST_LIB rclcpp) For more ...
JRTG's user avatar
  • 2,074
1 vote

ROS2 rclcpp subscriber callback uses same shared_ptr for each new message

Following advice from Steve Macenski, updating to a more recent version of ROS fixes this problem. In reviewing the changelog, the relevant ticket and fix is here: https://github.com/ros2/rclcpp/pull/...
edgex004's user avatar
1 vote
Accepted

rclcpp ROS2 params yaml file comments

Ok, not sure what was the reason for the error, but after some other things on focus it all seems to work fine even with comments. Thanks for the help anyways. And thanks @reason_rock for your comment....
magladko's user avatar
1 vote
Accepted

Nav2: Migrate from nav_msg::getPlan

Ok, after trying I ended up with an implementation that works. I was almost there, actually. The solution summarizes as: Multithreaded executor. Two callback groups ...
joanvallve's user avatar
1 vote

Using ImageTransport in a constructor throws std::bad_weak_ptr

There are ways around this, e.g., having an initialize method that is called externally or using a timer that calls an initialize method (very hacky and prone to hard to find bugs, don't do this). ...
Stefan Fabian's user avatar
1 vote
Accepted

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

All floating point Parameters end up being doubles under the hood - so your "declare_parameter" is basically being recast as "declare_parameter" - and then the implicit conversion ...
Mike Ferguson's user avatar
1 vote

ROS2 multi-threaded executor timers block subscriber callbacks

The default callback group is MutuallyExclusive, so by just running a node in a MultiThreadedExecutor, the callbacks will still not be called concurrently. See this previous answer for more info. EDIT:...
JRTG's user avatar
  • 2,074
1 vote

ros2 spinning problem[SOLVED]

what solved it for me was Callback Groups in ros2 which user @JRTG introduced...(https://docs.ros.org/en/iron/How-To-Guides/Using-callback-groups.html) now i will put my code and explain how Callback ...
arash mokhtari sherkat's user avatar
1 vote

Multiple servers in a single node [ROS2]

The multi-thread executor and assign two service separate callback group can solve this problem
Sorawit Inprom's user avatar
1 vote
Accepted

What is the difference between RCL_STEADY_TIME, RCL_SYSTEM_TIME and RCL_ROS_TIME?

The documentation on the different time sources is here: There will be at least three versions of these abstractions with the following types, SystemTime, ...
JRTG's user avatar
  • 2,074
1 vote
Accepted

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

I wrote some documentation here: there is a hash table (__logger_map) that links logger and child logger names to the respective publisher. I think this is the ...
JRTG's user avatar
  • 2,074
1 vote

rclcpp::Time epochs

I think the issue is in the unsigned() cast. Code changed to this: ...
JRTG's user avatar
  • 2,074
1 vote
Accepted

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

ROSNode::SharedPtr is a typedef inside rclcpp::Node that is always a ...
oKermorgant's user avatar
1 vote

How to unsubscribe from a topic

It appears that RVIZ properly unsubscribes when displays are disabled by simply calling reset() on the Subscription shared_ptr. I confirmed this checking that the subscriber count falls when using &...
Mike Ferguson's user avatar
1 vote

Check if ROS2 Parameters Exist with RCLCPP

For future questions I would like to add that onwards from dashing there exists function has_parameter() within rclcpp::Node for ...
li9i's user avatar
  • 13
1 vote

ament_target_dependencies not linking an upstream ament package?

First and foremost, I'm not able to reproduce your linking error on Fedora using either Rolling or Humble. I dropped the target_link_libraries call that you ...
cottsay's user avatar
  • 116
1 vote

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

I've run your commands from above inside a Docker container that is used within VS Code via the Dev Containers extension. (This is just my favourite method - it's exactly the same as running the ...
Bi0T1N's user avatar
  • 468

Only top scored, non community-wiki answers of a minimum length are eligible