Skip to main content

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
10 views

How to use Pinocchio (C++) in ROS 2 Foxy?

I've posted the same question at stackoverflow, but I posted here again in the hope that I can get more related comments. I am trying to use Pinocchio library for robot (Franka Emika Panda in my case) ...
BlackFootedCat's user avatar
0 votes
1 answer
18 views

cv_bridge.h not found ROS2

I need cv_bridge on my cmakelist.txt. Cmakelist shows a path for cv_bridge.h, however there is no file on that name at that path. I have opencv 4.5.4,ros2 humble. I tried to install cv_bridge by ...
Zehra N.'s user avatar
0 votes
1 answer
15 views

Why is AddressBook.msg compiled as address_book.hpp in ROS2

I am a new ROS2 learner. I am practicing "Implementing custom interfaces" from ROS2 DOCS On step 2, it require to creat a file called AddressBook.msg But ...
AndyGuo's user avatar
1 vote
0 answers
12 views

Creating an rqt_gui_cpp Plugin for RQT Using ROS2 and Qt

I am trying to create a custom rqt plug-in for RQT using C++ and Qt. I have a namespace with a class in my main.cpp. Within the class is the main initPlugin(rqt_gui_cpp) function that is supposed to ...
John's user avatar
  • 11
0 votes
1 answer
24 views

VSCode does not recognice RCLCPP_INFO

For days, I've been struggling with my VSCode setup. By no reason, VSCode started highlighting all RCLCPP_INFO, RCLCPP_WARN, RCLCPP_ERROR, ... function calls. The error message is as follows: I ...
Max123's user avatar
  • 1
0 votes
2 answers
21 views

ROS2 Humble C++: Calling a Service and waiting for a response within a ROS2 Callback

I'm working on a ROS2 Node that has a callback, that when it receives a new message should send a ROS2 Service call to a particular Server, and wait for a response before continuing. Furthermore, when ...
AndrewD's user avatar
0 votes
1 answer
26 views

ROS2 rclcpp understanding get_topic_names_and_types()

I came across this function get_topic_names_and_types in rclcpp recently and I have a basic question about it. Output type is <...
aarsht7's user avatar
  • 113
0 votes
2 answers
44 views

Standard input/output stream in C++ ROS 2 nodes?

I am trying to use std::cin and std::cout inside a function that also creates a ROS node. When doing so, the program gets ...
sniegs's user avatar
  • 60
0 votes
0 answers
17 views

Garden: create ball joint from C++ plugin

I'm a little but confused but can't find out how to create a ball joint from a C++ gz::sim::System plugin (from Configure ...
ntfs.hard's user avatar
  • 101
0 votes
0 answers
14 views

Use of underclared identifier 'ros'

I made a kinematicsNode by C++, as belows. But, Some error happened. Do you know what is the reason? ...
A_u's user avatar
  • 1
0 votes
0 answers
11 views

Moveit setPoseTarget inaccurate

I'm using Moveit! with ros-noetic on Ubuntu 20.04.6 LTS, on a Franka Emika Panda 7DOF robot. When attempting to move the robot using setPoseTarget with a small distance (1 cm), and then calculating ...
a_boroka's user avatar
0 votes
0 answers
26 views

Issue with message filter Subscriber in combination with LifecycleNode

I'm facing a compiler problem when trying to use message_filters::Subscribers within a LifecycleNode. Using these private class variables of my class ...
Max123's user avatar
  • 1
0 votes
0 answers
14 views

How to serve dynamic status information from a sensor via ROS node

I'm learning how to code a C++ driver for ROS2 (Humble, at the moment) to access a custom measuring device. Beside continuous measurement data streams and parameters for static configuration, the ...
kawk's user avatar
  • 1
0 votes
0 answers
20 views

Memory Increase Investigation in a Large ROS2 Planner Node with Mixed Python and C++ Code

I have developed a substantial ROS2 Planner node containing various navigation algorithms, with some components written in Python and others in C++. Pybind11 is used to call C++ algorithms from the ...
Mujadid Ali's user avatar
0 votes
1 answer
32 views

cmake error :CMake Error at /opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:271 (message):

cmake version:3.22.1 ros: melodic in Ubuntu18.04 when I "catkin_make", and report an error as follow: -- Using these message generators: CMake Error at /opt/ros/melodic/share/genmsg/cmake/...
user24464245's user avatar
1 vote
0 answers
27 views

Do subscribers in ROS2 have to subscribe to the same data types as publishers?

I would like to modify the message posted by the publisher directly from the subscriber side. So I tried the following method: pass reference to modify directly on subscriber side, but it doesn't ...
xudadi's user avatar
  • 11
0 votes
0 answers
34 views

ROS2 rqt C++ plugin, undefined symbol from qt_gui_cpp

I am trying to port a Noetic C++ rqt plugin to ROS2. I did not find any tutorial or help, except question 103235 here (Where can I find an example of a C++ ROS 2 rqt plugin?). It led me to look at ...
Alexis Scheuer's user avatar
0 votes
1 answer
41 views

ROS file structure

Can someone please explain the ROS2 file structure. I am trying to build a package and I am not sure how to approach the following problem. I have a c program that should use a file for config data (...
michael86's user avatar
0 votes
1 answer
37 views

Convert double to std_msgs::Float64 for ROS topic

I have to publish a float64 value in a topic and I'm using C++. The problem is that the original value is a double, so I'm not able to find any way to convert the double into a float64 and publish it. ...
Marcus Barnet's user avatar
1 vote
1 answer
17 views

Different simulation speeds between Python controller and C++ controller in Webots

I am working on a project in which i want to use Reinforcement Learning to fly the Crazyflie drone. To do this, i need the webots simulation to run as fast as possible. I managed to create a python ...
PLLBSS's user avatar
  • 11
0 votes
1 answer
43 views

Linear Tool movement with ROS2 moveit2 as in Rviz

I am using a real UR10e controlling it with ROS2 Humble on my Ubuntu 22.04. I am able to control the arm through Rviz when I ...
Single-Arm-Endeavour's user avatar
0 votes
0 answers
21 views

How to lift some object in Gazebo Harmonics?

I am making my "Hello, World" plugin in Gazebo Harmonics. I'm trying to lift some object upwards, i. e. to move it with the constant speed. Like this I plan to understand C++ classes to be ...
Oleksandr N.'s user avatar
1 vote
1 answer
23 views

Can't colcon build ros2 humble package for UR10e control

I am using ros2 humble to control a ur10e robot. I have successfully installed drivers and can use ...
Single-Arm-Endeavour's user avatar
0 votes
3 answers
50 views

How to include a code generated Matlab function into a ROS 2 C++ node

I generated a matlab function for a Quadrotor trajectory generation. Now I want to include this function into a pre existing ROS2 C++ node. Unfortunately, when compiling I get an error: ...
ric-enr's user avatar
  • 21
1 vote
1 answer
31 views

Need for Gazebo plugins and SDF tutorial

I am just beginning to work with Gazebo. I need to create drones models with autotesting and plugins that will communicate with firmware. Also I plan to use genetic algorithm for AI based drones ...
Oleksandr N.'s user avatar
1 vote
0 answers
24 views

How do I access a device inside a procedural proto node in the robot controller when the proto is regenerated mid-simulation?

Context: I've made a procedural proto node that contains several proto sensors. It works basically by having an MFNode field in the definition that I put my proto-gps in (that proto contains basically ...
Pyphais's user avatar
  • 31
0 votes
0 answers
19 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
7 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
35 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
14 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
13 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
38 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
27 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
20 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
122 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
44 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
20 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
43 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
68 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
63 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
45 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
64 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
214 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
57 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
16 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
26 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
  • 21
0 votes
1 answer
161 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
56 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
43 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
195 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

1
2 3 4 5
17