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
1 vote
0 answers
368 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
275 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
25 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
0 votes
0 answers
85 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
49 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
99 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
126 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
192 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
27 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
0 votes
1 answer
86 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
37 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
1 answer
345 views

How to set planning frame in MoveIt 2

I have a custom MoveIt 2 package for a UR5e robot. While planning and executing the movement, I noticed weird movements where the robot didn't seem to move as expected. I noticed that ...
sniegs's user avatar
  • 50
0 votes
2 answers
124 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
1 answer
225 views

linking .so files to ros2 package

Hello Im trying to write a client node using ros2 humble hawksbill distribution. For the node Im using a shared library for my depth camera. I have linked the .so file as I would normally do in my ...
Victor's user avatar
  • 1
0 votes
0 answers
419 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
67 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
22 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
2 votes
2 answers
452 views

Transform PointCloud message

I am receiving a sensor_msgs::msg::PointCloud (base_link frame) in my callback. I want to transform this PointCloud to the camera frame, so that I can do a ...
renan's user avatar
  • 53
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
80 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
2 answers
83 views

C++ can not build simple test program after update (Ubuntu 22.04/ROS 2 Rolling)

I just updated my Ubuntu 22.04 installation with ROS 2 rolling on it and now when I try to rebuild my ROS packages I get an error message that it can't compile a simple test program: ...
madgrizzle's user avatar
0 votes
1 answer
69 views

Is it bad practice to declare the node as a global variable to call a service from an external callback?

I want to call a service SendError from a registered callback from an external library. The only way I see I can do this is by having the node declared as a global ...
Adria Subirana Perez's user avatar
0 votes
1 answer
20 views

Not getting the correct response from the controller serial communication

I am trying to communicate with a Roboteq FBL2360TE brushless motor controller using serial communication, according with the controller's user manual if I send a ...
Diego Carvajal's user avatar
0 votes
1 answer
60 views

node crashes when subscribe to /image_raw topic

I am trying to consolidate a few nodes into a single process using nodelets. I have a ObjectDetectionNodelet that has a subscriber that subscribes to the raw image ...
nebula's user avatar
  • 1
0 votes
1 answer
67 views

waitForTransform kills node after changing static tf

I am new to programming and robotics and need help solving a problem i just can't solve. I am working on an art project with three ROS robots built by Wheeltec. (https://community.robotshop.com/robots/...
Ryuneke's user avatar
  • 21
1 vote
1 answer
31 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
0 votes
1 answer
228 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
119 views

How to deserialize ROS messages from Bag to ROS defined types in C++?

I want to deserialize messages from a Bag file and publishing part of their contents with ROS for further processing. I read a bagfile with the ROS C++ API. I know exactly the content (topic names and ...
tricostume's user avatar
0 votes
1 answer
40 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
130 views

IMU sensor Vectornav VN100 driver doesn't post any INS messages

I've already posted the same question on the GitHub page of the VectorNAV driver: github.com/dawonn/vectornav/issues/128 But no luck, noone gets back to me, looks like the branch isn't in much support ...
kozinofsky's user avatar
0 votes
1 answer
2k views

fatal error: #include "rclcpp/rclcpp.hpp" no such file or directory

I have a Raspberry Pi 4 with Ubuntu 22.04 and ROS 2 Iron Irwini, I have been able to run the tutorials, but when I run a ultrasonic ranger program I get fatal error ...
user35880's user avatar
1 vote
2 answers
338 views

Dynamically creating publishers in ROS2 Humble

I am pretty new to ROS and would like to get some insight into if what I am creating is good and/or viable. The system that I am making has a Publisher Node and a unknown number of Listener nodes (the ...
Vladimir Kostic's user avatar
1 vote
1 answer
264 views

Linking wiringPi Library with ROS2 service (serial) through CmakeLists.txt

I have a ROS2 package where I want a client to ask for a location, and the server sends coordinates back over ethernet that it's gotten from a GPS board which connects to my raspberry pi via serial. I'...
LVross's user avatar
  • 11
0 votes
1 answer
99 views

Build ROS code cpp without Catkin Package

Hello Community, So I have been working with ROS lately, it was really easy testing code in python where I just had to import rospy to work with ROS as I wished. I would then execute my programs with $...
user avatar
0 votes
1 answer
185 views

How to resolve 'nullptr not declared in this scope' compiling error in Ros_lib blink example and other ros_lib examples Ubuntu 20.04 with ROS Noetic?

I am new to ros and I am using virtual machine with Ubuntu 20.04 and ros neotic in it. I have installed rosserial arduino package step by step from this. After this I open ros_lib blink example and it ...
Maaz Ismail's user avatar
1 vote
1 answer
412 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
0 votes
1 answer
276 views

Where can I find an example of a C++ ROS 2 rqt plugin?

So far, I've only found ROS 2 rqt plugins ported over from ROS 1 that were written in Python. The docs (https://docs.ros.org/en/rolling/Concepts/About-RQt.html) mention writing custom plugins in both ...
user avatar
0 votes
1 answer
38 views

Subscriber callback inside class not recognized C++

I have created a class that contains a ROS subscriber and the callback function. I have done this following the ROS tutorial and according to other answers that I have found (for example here). I have ...
user avatar
0 votes
1 answer
14 views

nodelet: can't add argument to constructor

I am writing a ROS nodelet in which I have a GetInstance() method. I am trying to parse a string argument and it's throwing me the error. Can someone point out how this error can be fixed?? Any help ...
user avatar
3 votes
2 answers
284 views

How to Access Robot Fields Inside a Webots-ROS2 Plugin?

I'm running Webots R2023a where I have a robot node marked as Supervisor in Webots world (*.wbt file) to be controlled by an external node in ROS2 network. When writing a webots-ros2 plugin, I'm faced ...
S4JJ4D's user avatar
  • 33
0 votes
1 answer
109 views

Drive to point PID doesn’t work properly

This is my first post here. I am trying to get a robot I’m working on to drive to a point via a PID controller. My code works fine if the point is in front of the robot, but completely falls apart if ...
SprintKeyz's user avatar
0 votes
1 answer
32 views

code_coverage for ROS usage

I am new in ROS and I apologize if the question might be simple or common sense. I am trying to use this package (code_coverage) for measuring code coverage for ROS package but unfortunately no ...
user avatar
0 votes
1 answer
46 views

sensor_msgs::PointCLoud empty in Callback but rostopic echo gives values

Hello, I want to work with a sensor_msgs::PointCloud I am provided with by a laser scanner. I subscribed to the topic /riegl3d and the Callback is executed but the PointCloud is empty. For example the ...
user avatar
0 votes
0 answers
59 views

Hole detection on ROS with a stereo camera

I am trying to make a node in ROS that has as input a dynamic point cloud that is generated with a stereoscopic camera to which I have performed preprocessing. Now that point cloud that is generated ...
JhonathanR's user avatar
0 votes
1 answer
3 views

What is the difference in how you assign these node parameters? (C++)

I have a node and I want assign 2 parameters from the Parameter Server. They are both strings: ...
user avatar
0 votes
2 answers
119 views

How could you have controllers communicate with each other?

I have been attempting to have two controllers be able to access information from each other in a way that is similar to object-oriented programming in UNITY, however, I have constantly had problems ...
Jonathan Ariel Callejas's user avatar
0 votes
1 answer
362 views

How to create ROS2 library with dependence installed with CMake FetchContent?

I want to create a package that combines the rclcpp libraries and an external library installed with CMake FetchContent. How do I properly create a cmake file? I have already tried different ways, but ...
user avatar
0 votes
2 answers
347 views

How to create a vector of message_filters::Subscriber?

When I try to create a vector of message_filters::Subscriber like so: ...
Samuel Rodríguez's user avatar

1
2
3 4 5
17