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
6 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
17 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
30 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
13 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
11 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
23 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
18 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
30 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
24 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
50 views

Obtaining rotation and translation matrix from homogeneous transformation matrix

I have following piece of code: ...
RajS's user avatar
  • 101
0 votes
2 answers
137 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
41 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
11 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
17 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
60 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
24 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
32 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
106 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
78 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
63 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
64 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
48 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
79 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
63 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
231 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
55 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
26 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
31 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
61 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
71 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
55 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
227 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
487 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
73 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
72 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
31 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
300 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
194 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
73 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
51 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
20 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,353
0 votes
0 answers
69 views

MA57 Installation for Ipopt C++ library (x86_64, Ubuntu 9.4.0-1ubuntu1~20.04.2)

I've been working with Ipopt C++ library optimizer regarding trajectory optimizing tasks. By default the ipopt c++ uses MA27 solver (which is free for usage). I've found out that the best Licensed ...
Vladimir's user avatar
0 votes
0 answers
42 views

Subscriber in python to std_msgs.msg.Float32 crashes when the maximum float-32bits is sent

Setup: a publisher in c++ of std_msgs/msg/Float32 sends the maximum float-32bits (using std::numeric_limits::max()) a subcriber in c++ to the topic above works just fine a subcriber in python to the ...
POtaoPereiraRosen's user avatar
0 votes
0 answers
85 views

ROS2 node crashes abruptly

I have a legacy code in ROS1 that has the following code ...
RobotBramhana's user avatar
1 vote
2 answers
125 views

colorize area of point cloud on a 2D image

I am projecting a 3D Point Cloud on a 2D image incoming as ROS 2 messages. Now, I want to fill the gaps between pixels from the point cloud, so that I can see an area, instead of single pixels and ...
renan's user avatar
  • 53
0 votes
1 answer
142 views

ROS 2 - Poincloud2 message drop when trying to display in RVIZ2

I want to send a dummy PointCloud2 message to be visualized with RVIZ2, but when I try to subscribe to the pointCloud2 message, I received the following error : [INFO] [1698326059.380456033] [rviz]: ...
Gregzz's user avatar
  • 3
0 votes
1 answer
25 views

How to improve NodeHandle build and execution errors

Raspberry Pi 4, Lubuntu20.04, ROS1-noetic Please help me because I am getting an error with NodeHandle My program is below (Some Japanese is mixed in) The publish node will be as follows https://...
S.Tomo's user avatar
  • 7

1
2 3 4 5
16