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.

58 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
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
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
1 vote
1 answer
26 views

Could I create multi dynamic_reconfigure in one package in one CMakeList?

I have two *.cfg files, each one working with its executable process. The CMakeLists: ...
Adam Peng's user avatar
1 vote
1 answer
325 views

How to detect the position in a linear actuator?

I was planning on 3D printing my own 30 cm stroke length 3D printed linear actuator and I don't know how I could read its position, or tell it to go say to 16.5 cm. I used this video, 3D Printed ...
Mito's user avatar
  • 111
1 vote
0 answers
25 views

Getting the new heading after a Transformation

Lets say I have 2d poses as such (angles in degrees): world_to_robot = {0, 4, 45} robot_to_object = {4, -4, -45} From a graph it would be easy to see that: world_to_object = {4, 8, theta}, what goes ...
notARobot's user avatar
1 vote
0 answers
75 views

How to correctly use [VertexSE3Expmap] as two connecting Vertex in Edge_V_V_GICP?

I am working on a pose estimation problem solved by Levenberg-Marquardt with g2o. I want to build 3D rigid constraint between two pose, so I choose Edge_V_V_GICP and test the g2o/examples/icp/...
Jerry123's user avatar
1 vote
0 answers
56 views

Any way to program a robot remotely?

So Udacity, Kuka and KIT are/were offering a Kuka challenge. Basically, the participants got to write code and run it remotely on a Kuka robot based in the KIT labs in Germany and submit their code ...
Andros Adrianopolos's user avatar
1 vote
0 answers
290 views

Detecting and counting the number of junctions

So I am making a robot which is to follow a line. The field has both +(junctions) as well(by the intersection of two lights). I am yet to figure out what exactly is the best way to track the number of ...
robotlover's user avatar
1 vote
0 answers
216 views

Scaling monocular SLAM with another source?

I have implemented a stable monocular slam tracking system, based on ORBSLAM2. I am trying to find a way to add real-world distance/scale to this. At the same time, I am running a (less stable) ...
anti's user avatar
  • 153
1 vote
0 answers
5k views

accelerate a stepper using arduino AccelStepper starting with a pre-defined speed

I've read the AccelStepper documentation on airspayce.com and it seems to be not possible to accelerate a stepper starting with a speed greater 0. Acceleration always starts from speed=0, I tried it ...
mika's user avatar
  • 111
1 vote
0 answers
829 views

Firmata over nRF24

I'm having some technical problems... I'm trying to use Firmata for arduino but over nrf24, not over Serial interface. I have tested nRF24 communication and it's fine. I have also tested Firmata over ...
Aleksandar Toplek's user avatar
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
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
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
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
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
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
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
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
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
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
0 votes
1 answer
82 views

how to visualize the sensor data!

now I am making the node for my custom lidar. the struct of this lidar pointcloud is ...
lee dida's user avatar
0 votes
0 answers
35 views

stamp error with lidar

This is a problem that occurred while connecting and using the YDLIDAR X2 lidar sensor to the Raspberry Pi. https://github.com/YDLIDAR/ydlidar_ros_driver I use this package. it worked normally on ...
MobileRobotics's user avatar
0 votes
2 answers
94 views

Associate two executors for a single node

I am running ROS2 Humble Hawksbill, I have a requirement where in I need to associate two executors StaticSingleThreadedExecutors for a lifecycle single node. I ...
RobotBramhana's user avatar
0 votes
0 answers
352 views

Ipopt error: malloc(): invalid size (unsorted) Aborted (core dumped)

I'm working with Ipopt C++ library (https://github.com/coin-or/Ipopt). Planning to work on optimization of trajectories soon, but for now I'm practicing on the simple tasks. In particular I've been ...
Vladimir's user avatar
0 votes
0 answers
61 views

How to make the connection of dynamixel become modular by using ros2 control hardware interface

I'm trying to make the robot that using dynamixels to control the movement of the joint. One of the application is that when one leg of the robot is disconnected, when I connect it again the software ...
THA's user avatar
  • 3
0 votes
0 answers
21 views

Camera pose estimation problem

I am creating a Pick and Place program and need help with pose estimation. I am broadcasting on RViz the coordinates based on my YOLO detection and camera. Below is my broadcasting node. ...
emanuel rodrigues's user avatar
0 votes
0 answers
63 views

Where are the signatures to callbacks such as this->client_->async_send_request( request, callback );

Sorry if this is dumb question I am new to C++ In node member functions such as: this->client_->async_send_request(request, callback); Where are the signatures to the callback functions ...
threebits's user avatar
0 votes
0 answers
68 views

Segmentation fault in cv::findContours call

I am struggling to debug a segmentation fault. Any help is appreciated! The node just crashes whenever I launch it and following is the seg fault I am getting when running through gdb: ...
nebula's user avatar
  • 1
0 votes
1 answer
191 views

Using TensorFlow in ROS2

I'm trying to add gesture recognition capabilities in my ros2 humble C++ package, and I started out with trying to use the TensorFlow C++ API. However, I am unable to install TensorFlow for my ROS2 ...
KK29's user avatar
  • 23
0 votes
1 answer
38 views

ROS node reading from bag not exiting correctly

I need a C++ script which can read through bags and do some processing, basically the structure is going to be ...
Morten Nissov's user avatar
0 votes
2 answers
74 views

Rosbridge in C++

Hi everyone, I'm having a project to build a user interface with ROS in C++. I found that rosbridge is a useful tool but the rosbridge client only support java script, java and python. Is there any ...
user avatar
0 votes
2 answers
50 views

Calling publisher at a specific rate

Hi, I have a node that subscribes to a topic, does some computation and publishes the message on a different topic. The publish is implemented within subscriber callback function. While the subscribed ...
user avatar
0 votes
2 answers
115 views

How to make C++'s service call method wait for server's response?

I need to call three consecutive service call from c++ node like this ...
user avatar