Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [c++]

C++ is a compiled general-purpose programming language that adds object-oriented features and other enhancements to the C language. It is popular for both embedded (including robotics) and PC software development.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

Reading Global Parameters in ROS2

I am trying to have a global parameter node and a client program that reads the global parameter off of the global parameter node. I am using ROS2 Foxy. Here is the global parameter node with just one ...
Farbod's user avatar
  • 1
0 votes
0 answers
3 views

Synchronizer not working when built inside a class

I need to subscribe to two different topics (PointCloud2 and PoseStamped) in a synchronized manner. First thing I did was to write a simple callback function and test if message_filters was working ...
Alessandro's user avatar
0 votes
1 answer
24 views

Create self-contained standalone ROS1 application for Windows

I created a ROS Noetic package that grabs data from some cameras and performs pose estimation of objects in the field of view (using OpenCV). Simultaneously, IMU data is measured and fused with these ...
masteryoda436's user avatar
1 vote
0 answers
8 views

Error on include my own library in ROS service

I have coded my own library for some purposes and use it in a ROS service. After modifying the CMakeLists file I get the following error: undefined reference to `decirHola()' collect2: error: ld ...
Juan Perez's user avatar
0 votes
0 answers
7 views

Segmentation fault ('core dumped') - Summit XL navigation

When I execute this node I receive the error mentioned in the title and I had already tried many things but anything worked, what can I do? ...
DiegoMp's user avatar
0 votes
0 answers
21 views

Moveit collision detection not working with stl mesh object

I've succesfully added two objects for testing. One of them is a primitive box and the other is a mesh object imported from an stl file. I can visualize them in Rviz and when I move into the objects ...
Nihat's user avatar
  • 1
0 votes
0 answers
16 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
0 votes
0 answers
18 views

Is it possible to run the same world on parallel Gazebo simulations?

I'm trying to understand whether it is possible to run parallel simulations of the same world using concurrent instances of Gazebo Servers, and if so how to do it. Is this supported out of the box? ...
Xela95's user avatar
  • 33
0 votes
1 answer
57 views

ROS2 Send Image Through Service (C++)

I'm relatively new to ROS2 and have been relying on tutorials and online resources to navigate my learning journey. Currently, I'm trying to send an image via a service request, but despite my efforts,...
Heron Saba's user avatar
0 votes
0 answers
37 views

How to cleanly stop a robot in the destructor of the code

I often use CTRL-C to stop my ROS2 code. However, I wonder why my destructor is not executed or not executed in sequence. According to my log file, the destructor was called: ...
Dom's user avatar
  • 1
0 votes
0 answers
14 views

Building a node with a custom IDL message with conan2

I am migrating from conan1 to conan2. Unfortunately my ROS node which depends on a custom IDL message interface is not built successfully anymore in conan2. The linking stage fails with: ...
Oscillon's user avatar
  • 101
0 votes
0 answers
26 views

Migrating sensor plugin to gzsim harmonic

I have migrated a custom sensor plugin based on ray sensor (from gazebo classic) to a system plugin based on GPU lidar (gzsim - harmonic). How can I convert this ...
Rômulo Cerqueira's user avatar
1 vote
1 answer
24 views

pcl_conversions/pcl_conversions.h not found when colcon build, but appriopriate packages are installed

I bought a LiDAR D4 on AliExpress and received a package from the buyer with a driver for ROS2. Unfortunately, I get the following errors when calling colcon build: ...
krzaczor93's user avatar
1 vote
0 answers
37 views

How to use pre-built static library on ROS2 node

I have .a file and header file (.h) for an SDK for a thermal sensor. This is my package structure. ...
yuan's user avatar
  • 11
0 votes
1 answer
33 views

How to get joint position limits in Gazebo

How can I get the joint position limits in (the new) Gazebo? From the migration guide for the Joint API it is listed that the corresponding methods from Gazebo classic are TODO, so I imagine the ECM ...
Xela95's user avatar
  • 33
0 votes
2 answers
53 views

Obtaining rotation and translation matrix from homogeneous transformation matrix

I have following piece of code: ...
RajS's user avatar
  • 121
0 votes
2 answers
172 views

How to add a custom sensor plugin?

Currently I'm trying to write my own sensor plugin, based on the examples odometer and odometersystem from the git repository, but am failing to add the plugins to gazebo. The system plugin ...
TheRobotDude's user avatar
0 votes
1 answer
54 views

Assistance downloading UR interface for Ros2 humble

Im getting an error for downloading the ur robot driver. its a line inside a c++ file causing the issue, i cant find the right command to use. Heres the error, please help! ...
Morgan Fabbricatore's user avatar
0 votes
0 answers
14 views

How to set the zero angle of a revolute joint differently from SDF

I would like to set the zero angle of a revolute joint differently from how I define the joint frame in the SDF. For example, take a pendulum constituted by a base link, a revolute joint and a ...
Xela95's user avatar
  • 33
0 votes
0 answers
20 views

Access position of entities from a plugin

I'm trying to implement a simple light sensor plugin in Gazebo Ignition; this will be output measurements based on the distance between the object (where the plugin is attached) and the light sources. ...
Paolo's user avatar
  • 11
0 votes
1 answer
88 views

How to add wiringPi library with cmake on vscode?

I tried a few things but I am not so knowlegable about it. I tried with cmakeLists.txt: ...
Jonathan Dawsa's user avatar
0 votes
0 answers
36 views

RCLCPP ROS2 check if node is already running

I have noticed my node can be re-run as a second time. While using python before, this was not a problem, as when you launched the node the second time, it would return an error. What is the best ...
Can Altineller's user avatar
0 votes
1 answer
38 views

Calling ROS2 subscriber callback function from another function

I try to use x and y in timer_callback function but I get ‘x’ was not declared in this scope I don't know how can I do this ...
HCA's user avatar
  • 3
0 votes
1 answer
159 views

C++ Publisher and Subscriber in ROS2

I use Ubuntu 20.04 and Ros2 Galactic when I run the code I'm able to get subscribe information and pub this information and also I can see publisher information on topic echo continuously but when I ...
HCA's user avatar
  • 3
0 votes
0 answers
16 views

How to run multiple nodes in the gtest?

I have 2 packages in my catkin_ws, pkg1 and pkg2. I want to run gtest for pkg1 but it requires pkg2 to receive the data before ...
Jeonghyun Jo's user avatar
0 votes
2 answers
49 views

C++ Refactoring help

I am working with C++ for a Teensy (Arduino-like board). There is a pattern that I have a lot which annoys me because it is tedious and ugly. But I don't know how to refactor it to make it less ...
pitosalas's user avatar
  • 465
0 votes
1 answer
132 views

turtlebot4 nav2: how to call action navigateToPose from node in cpp

I am migrating a node that send goals to nav2 (originally move_base) thru an action since I need to know if it has been reached or cancelled by the planner. It will work with the Turtlebot4. I've been ...
joanvallve's user avatar
0 votes
1 answer
64 views

C++ Code is giving an error that I can't understand:

This code is a very simple extract from what I am really writing. But I am getting stuck on references and dereferencing. To explain this. NodeHandle stands in for a very large class from my framework....
pitosalas's user avatar
  • 465
0 votes
1 answer
27 views

Writing a Publisher and Subscriber to wirelessly communicate over 2 Linux PCs in C

I have code that is written in C that has a corresponding executable file and both work the same. Both run in a terminal and everything outputs into the same terminal. I am trying to make that code a ...
Libby Williams's user avatar
0 votes
1 answer
67 views

How to rotate a Homogeneous Transformation Matrix about multiple axes?

I am working on a forward kinematics problem where I have already calculated the relevant transformation between the fixed base frame and the end effector frame of the robotic arm using Homogeneous ...
Anubhav Singh's user avatar
0 votes
1 answer
52 views

How to work with a custom joint states topic which involves a robot namespace?

I am working with a robotic arm in simulation. I am using ros-noetic, gazebo and moveit for this purpose. I am using /robot_namespace as robot namespace, because of ...
Anubhav Singh's user avatar
0 votes
0 answers
80 views

Adding ROS2 to existing C++ Project

I have joined a project where we use a third party program that runs on another computer and sends messages via ROS2 (topics and services). Our goal is for our own code to be able to receive these ...
T3 K14's user avatar
  • 1
1 vote
2 answers
72 views

undefined symbol: GzPluginHook

I'm trying to make custom gz sim plugin by following the examples folder. After build the example I'm getting error gz sim -s -v 4 sample_system.sdf: symbol lookup error: /home/JF/Projects/...
Jay Parikh's user avatar
0 votes
1 answer
339 views

ROS2 Message Serialization to String in C++

I have a simple subscriber to a topic in C++, and am receiving a custom PositionMsg, which includes other custom messages (Velocity, datum, etc). ROS2 handles all that very well, I'm getting the ...
C Dorman's user avatar
  • 103
0 votes
0 answers
63 views

ROS2-Ompl integration build error

I am a total noob in cpp and linux terminal. I am working to get my little turtlebot3 in simulation to navigate through the map I generated through ros slam. Now I am facing some errors when using tf2 ...
Venkat Balaji's user avatar
0 votes
0 answers
27 views

Gazebo 11.14 Physics ContactManager Update Rate

I am using Gazebo version 11.14.0 with ROS Noetic. I searched in the Gazebo API documentation for the update rate of the physics contact manager: ...
Wadhah's user avatar
  • 1
0 votes
0 answers
33 views

Compilation Errors with Gazebo Plugin on Windows

I am currently working on a project where I need to build a Gazebo plugin for a UR5 model. My development environment is set up on Windows, and I am using MinGW as my compiler within a Conda ...
Dev's user avatar
  • 1
0 votes
1 answer
78 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
1 answer
72 views

Unable to debug ros_controllers built from source

I would like to debug joint_trajectory_controller in ros_controllers package while running Gazebo and RViz through a launch file ...
01 Binary's user avatar
  • 141
0 votes
1 answer
75 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
0 answers
329 views

ROS2 C++ custom node using image transport not subscribing to a topic

I am trying to write a custom ROS2 node in c++ that subscribes to /depth_to_rgb/image_raw coming from Azure Kinect of type 'sensor_msgs/msg/Image' topic. Then I am trying to get a depth value at a ...
kmartbirthdaycake's user avatar
0 votes
2 answers
590 views

Installing ros2 on ubuntu 23.04

Recently, I wanted to try installing ros2 on ubuntu 23.04 or later versions. How can I do it? Thanks in advance
Maidul Islam's user avatar
0 votes
0 answers
106 views

How do you change a ROS2 WallTimer period after initialization?

Is there a way in ROS2 to use the ROS1 WallTimer function setPeriod? I'm trying to change the timer's period in runtime in my C++ node. Currently I cancel the ...
Yato's user avatar
  • 58
0 votes
1 answer
83 views

Who has gotten WiringPi working in a ROS 2 C++ node? Want to control GPIO on Raspberry Pi 4 running Ubuntu 22

What I've tried and works to know the WiringPi library is working on my Raspberry Pi 4. g++ compiling a test cpp script using <...
Yato's user avatar
  • 58
0 votes
0 answers
36 views

Clarification on ROS2 argument types for srv/sub callbacks

I need some clarifications on the type of arguments to use in callbacks for service and subscriptions in C++. I’m considering both service input and subscriptions, because, from my understanding, what ...
Michele Colombo's user avatar
1 vote
0 answers
349 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
2 answers
250 views

How to convert the kittti dataset into ros2 bags?

How to convert the kitti dataset into ros2 bags, or is possible to download it already converted?
Richard Jose's user avatar
1 vote
0 answers
86 views

Peek at the message queue for a ROS2 topic subscriber in a callback

I'm sure this facility was in ROS1 (although this post suggests it wasn't) but I cannot find it in ROS2. Basically in my subscription callback I want something like this pseudocode: ...
Ken Y-N's user avatar
  • 143
0 votes
1 answer
54 views

Couldn't find executable named microstrain_mips_node

I installed ROS microstrain_mips using git clone in my workspace. Here is the Wiki page of the package. However, my current ROS ...
Jaesung Yang's user avatar
0 votes
1 answer
22 views

How to use libSegFault with ROS node(let)s?

I'm trying to debug a segmentation fault on a ROS nodelet. I've tried to use libSegFault by adding the following lines to CMakeLists.txt: ...
xperroni's user avatar
  • 1,363

1
2 3 4 5
17