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
1 answer
67 views

Rostest and C++: Test node does not exist or is not executable

Hi! I'm trying to integrate my workspace with GitLab CI and have been encountering this issue in the CI shell: ...
user avatar
0 votes
1 answer
6 views

When exactly is a callback function executed?

Hello, I know that in general a callback function is executed when its associated topic has published values. What I am wondering is how do the commands spin() and spinOnce() in main affect the ...
smarn's user avatar
  • 9
0 votes
1 answer
2 views

ServiceServer declaration within a class

I'm running on Ubuntu 18.04LTS using ROS melodic and kernel 5.0.0-25-generic. I'm currently trying to add a service server to my c++ class. Is this possible? Should I declare the service inside my ...
user avatar
0 votes
2 answers
36 views

VS code can't find the headerfiles even when workspace compiles without error

Hi, I've been having this error where the squiggles in vscode don't go away when I try to include headerfiles for custom messages and services. I am able to compile my workspace, I can see the header ...
user avatar
0 votes
2 answers
4 views

Include methods from another node header (C++)

I have a node with some methods declared in /include/node_1.h and defined in /src/node_1.cpp. Now, I want to include that header ...
user avatar
0 votes
1 answer
4 views

Imu_attitude_to_tf_node Error: 'command not found'

I am attempting to convert data from the Pixhawk IMU to a transform broadcast using the "hector_imu_attitude_to_tf" node from the Hector SLAM repository (found at: link text ) However, when ...
user avatar
0 votes
1 answer
112 views

ROS2 QoS callback function

Hi everyone, First of all, I just learned about ROS2 so I am not so familiar with it. Also, I apologize for my bad English. I am now working on how to implement QoS in my subscription. I have a little ...
user avatar
0 votes
2 answers
101 views

How to add an external package to my node ROS2

Ubuntu 18.04 ros2 Dasing C++ Hi, I don't understand well where my CMakeLists get the packages, but it takes the ones installed when I installed ROS2 (std_msgs, sensor_msgs, rclcpp...), now I want to ...
user avatar
0 votes
1 answer
44 views

How to get pose from april tag topic tag_detection?

Hi, Currently, I have a bag file which publishes the /tag_detections coming from apriltag node. I'm having trouble in writing a callback function which could extract information like pose from the ...
user avatar
0 votes
1 answer
44 views

[ROS2] services C++

Hi, I'm trying to use services to work with a ROS2 canopen node. In ROS1 I was able to use this code: ros::ServiceClient init = n.serviceClient< std_srvs::Trigger>("/driver/init"); ...
user avatar
0 votes
1 answer
21 views

How to use data from a callback function in another function

I'm trying to take the x, y, and yaw value from the callback function and use them in a different function. Although when I run the code I have below, all the variables below return a value of 0. ...
user avatar
0 votes
1 answer
35 views

catkin install missing dynamic reconfigure header file

I've been created a package (named "stereo") that uses dynamic reconfigure for some stereo matching parameters and it has been working fine until i tried to catkin install them instead of ...
user avatar
1 vote
1 answer
238 views

Controller algorithm implementation in ROS/Gazebo

I am doing some robotic simulations in ROS/Gazebo and wondering what is the best way (programming-wise since I don't have a CS background) to implement a robot's motion controller. Here are the ...
Franky's user avatar
  • 536
0 votes
1 answer
7 views

How can I know the rate the publisher is sending a msg with c++?

I want to have a subscriber that is able to print the rate at which a message is being sent using C++, what is the best way to do it? The subscriber works in a really slower rate than the publisher. ...
user avatar
0 votes
1 answer
27 views

Timer callback function do not working when action server be called?

##Timer callback function do not working when action server be called?## Hello, I find a interested problem just now. It was action server callback function may ...
user avatar
0 votes
1 answer
81 views

Some Kalman filter implementation queries

Just to clear some doubts: Qn 1. Does kalman filter require constant time step? From my own study, it does not seem necessary to have a constant time step. You just need to take into account time ...
user1538798's user avatar
0 votes
2 answers
96 views

What happens if I use c++ 17 features in my ros nodes?

In the ROS manual/wiki you can see, that ROS is only made for C++11. But what exactly does that mean? What happens if I just put add_compile_options(-std=c++17) in ...
user avatar
0 votes
1 answer
8 views

Publish message received in callback

Hello, I am trying to do a simple node subscribing to a topic which send data of type TwoInts (a custom message), and publishing the sum of what it received. TwoInts.msg ...
user avatar
0 votes
1 answer
35 views

How to remove custom Rviz Plugin

I created rviz plugin following these tutorials . However I was wondering how can I remove them. I couldnt find any documentation/guidelines for it. Please provide any hints / suggestions. Thanks ...
user avatar
0 votes
1 answer
5 views

How to match messages coming from several nodes to be able to cross-reference data based on timestamps?

Hello, I was wondering whether it is possible to cache two synced messages with message_filters API in Melodic? I got two synced messages: ...
user avatar
2 votes
3 answers
1k views

How to implement path planning algorithm considering orientation?

I am developing GUI c++ program to test path planning algorithms: A*, Dijkstra, ....etc in occupancy grid map. I found many open source codes , but I need to modify them to design a GUI for testing ...
user599086's user avatar
4 votes
1 answer
93 views

Make robot drive as far from obstacles as possible

I am trying to make robot drive around the room, avoiding obstacles with pathfinding. The problem is I get few waypoints from pathfinding algorithm for robot to drive to (green dots), but it drive a ...
Name's user avatar
  • 41
0 votes
2 answers
61 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
1 answer
6 views

rivz only visualizes polygon stamped topic if the frame id is the same as the rviz "Fixed Frame"

I made a function that is supposed to visualize a zone as a polygon: ...
user avatar
0 votes
2 answers
17 views

Nodelets general confusion

Hello, I am trying to understand the whole nodelet concept, since there are bits here and there all over forums but I cannot find one whole info about it. What I know so far: Why use nodelets: zero-...
user avatar
3 votes
2 answers
3k views

How to get unix/posix time stamp in header of ROS msg?

I am using two sensors each connected to different machine (each machine separately runs Ubuntu 16.04 and ROS Kinetic). When I echo topic on these two machines, I ...
fhm's user avatar
  • 31
0 votes
1 answer
7 views

Empty ConnectionHeader in MessageEvent (C++)

Hi all, I am trying to get the publisher of a topic message in a C++ subscriber. However, when I subscribe to the topic via a MessageEvent<> callback and try ...
user avatar
0 votes
1 answer
12 views

error getMD5Sum in customized message type

Hi everyone, I am a newbie trying to create a customized message type but it always ends up with this error. I will appreciate greatly if someone can help out. I spent hours on this and don't know ...
user avatar
0 votes
1 answer
6 views

actionlib constructor initialization

I'd appreciate it if someone can explain the reason why the actionlib simpleServer constructor needs to be initialized as a constructor initializer list? If the initialization's removed the ...
user avatar
0 votes
2 answers
6 views

callback function doesnt printout the subscribe msg

hello guys iam new at ROS and iam trying to print the msg and some how it doesnt print it and i cant find where is the problem this is my code ...
user avatar
0 votes
1 answer
8 views

How to use move group interface in a sub function?

Hello, Because my robot have 3 different targets need to reach in a loop, I want to merge the same line of each move group in a sub function to let the whole program more easy to read. I think it will ...
user avatar
0 votes
2 answers
2k views

/odom topics not matching ERROR

I have an existing ROS workspace which was built in C++. I am trying to implement a node built by The Construct in python which reads distance travelled from the ...
neerbasu's user avatar
0 votes
1 answer
12 views

Where is this header file?

Hi I was looking at some code and noticed a header file that doesn't exist in the repo. This line includes a header "orb_slam2_ros/SaveMap.h", but it's ...
user avatar
0 votes
1 answer
11 views

Building Custom Message on Dashing Fails

When I run colcon build to generate a custom message on Dashing, I get the following error: ...
user avatar
0 votes
1 answer
151 views

ROS timer not working after including CallbackGroups

Hi everyone, I have a question regarding the CallbackGroups of rclcpp in ROS2. I'm trying to have an update cycle run by a rclcpp::TimerBase run on a specified update rate and at the same time the ...
user avatar
0 votes
1 answer
16 views

Error when trying to load and execute a custom nodelet

ENV: Ros Melodic on Ubuntu 18.04 Hi, I am trying to launch my custom nodelet after building it. after running a catkin_make without any problem and executing ...
user avatar
0 votes
1 answer
4 views

How to deal with the bug:‘Bag’ is not a member of ‘ros’?

Backgrounds: I am learning how to write/read a rosbag with C++ and I refer the Code API (see: link text). I create a rospackage and do some coding in Ubuntu 16.04 LTS and ROS Kinetic. But I meet some ...
user avatar
0 votes
1 answer
2 views

Two different nodes getting odometry messages

I'm using C++ to program two nodes on ROS melodic with Gazebo 9.9.0 running on an Ubuntu 18.04.2 LTS. I'm learning ROS and I have to do the same: move a robot, Pioneer 2DX, to make a map using ...
user avatar
3 votes
1 answer
899 views

Command line boolean parameters to ros node

I'm working with ROS melodic and Gazebo 9.9.0 on an Ubuntu 18.04.2 LTS. I want to get two boolean parameters from command line. To do it, I have this code: ...
VansFannel's user avatar
0 votes
1 answer
9 views

What are the JointStateHandle units?

Hi, I'm using ros_control c++ interface and JointStateHandle to update the motor feedback values. My question is about the units used in the parameters of the following line: ...
user avatar
5 votes
2 answers
260 views

How Can A Total Beginner Become A Skilled Roboticist?

Say the only computer skill you have is programming in C/C++...what all things would you have to learn in order to be an adept full stack roboticist, one who can single-handedly build an autonomous/AI ...
Coder Motor's user avatar
0 votes
1 answer
157 views

fatal error: serial/serial.h: no such file or directory in ros

Hello evrybody, I'm using ROS kenetic and I'm trying to read data from serial port of my laptop. For this I use the code below and I use the header file serial.h to instantiate my serial object. When ...
user avatar
0 votes
1 answer
17 views

Declaring moveit robot model in header file

Hello everyone, I am new to C++ with ROS and would love to get some help. Currently, I am trying to write a C++ class object. In the class, I want to share a moveit robot model so I can use it among ...
user avatar
0 votes
1 answer
19 views

Can't find package: cartographer_ros

I'm trying to get a marker array containing pose info from cartographer_ros. I got the 2D cartographer_ros demo working, and the Subscribe demo working. I'm now trying to modify the Subscribe demo to ...
user avatar
0 votes
1 answer
34 views

Compiler warning (c++11): Zero as null pointer constant

Hi, I'm using QTCreator with ROS Plugin and compilie my nodes with C++11 support. I get the following compiler warning when using e.g. ROS_DEBUG(). How can setup QTCreator to ignore this warning? <...
user avatar
0 votes
1 answer
22 views

Finding buffered frames in tf2_ros::Buffer (c++)

I am creating a post-processing utility where I read all the transforms from a .bag file into a tf2_ros::Buffer. I would like to be able to ask the Buffer for all the frames it has cached. I don't ...
user avatar
0 votes
2 answers
151 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
1 vote
0 answers
57 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
0 votes
1 answer
31 views

'double' is not a supported type in ROS messages?

Hello all, I meet two issues for the data type delcaration: Q1: I define the message in the svr file as below--but when I check the srv by rossrv show I got error message like: unknown srv type... ...
user avatar
0 votes
1 answer
8 views

How to get the actual coordinate for all of the joint?

Hi. I'm new to ROS Indigo. Is regarding the actual joint states, I have tried the rostopic echo /joint_states and /tf, but it seems like the joint_states and tf are keep on going non stop. May I know ...
user avatar

1
3 4
5
6 7
17