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
2 votes
3 answers
1k views

Spdlog linker error with ROS2 packages

Good afternoon! We are a company that has a pretty big robotic framework and we are currently working in a transition into ROS2. We are first creating the structure that all of our packages will ...
Jorge Playán's user avatar
0 votes
1 answer
16 views

Convert CameraInfo K & D to OpenCV format convenience functions?

Are there existing functions to convert from camera info arrays of K and D to intrinsic and distortion cv::Mats that can be passed into opencv functions like ...
Lucas Walter's user avatar
  • 3,347
0 votes
1 answer
68 views

MoveIt2 tutorial error Pick and Place

I'm using ros2 humble. I try to run the pick and place source code from the Moveit2 tutorial. At first i run ros2 launch moveit2_tutorials mtc_demo.launch.py after ...
user avatar
0 votes
1 answer
27 views

\rviz_visual_tools not shown in MarkerArray Topic's

I'm using ros2 humble. I'm working on the MoveIt 2 tutorial. After creating the Sourcecode i have to add the RvizVisualToolsGui and the MarkerArray. In the MarkerArray i have to change the topic to \...
user avatar
0 votes
1 answer
199 views

ROS2 message_filters Synchronizer compilation error

Hi, I am having trouble compiling my code using the message_filters Synchronizer in ROS2 Foxy. The tests included in the library compile and run fine but the code below does not want to compile on ...
user avatar
0 votes
1 answer
299 views

Configuring ROS2 for OpenCV and C++

How to properly setup the ROS2 workspace (i.e., cmakelists and package.xml, etc.) for using OpenCV and C++ ? I could not find proper examples for that. Thanks in advance. Originally posted by ...
user avatar
1 vote
1 answer
361 views

Can MoveIT framework be used separately from ROS, i.e. "as a standalone library"?

As far as I understand, MoveIT can act as a IK/FK solver one can supply input into (i.e. end-effector xyz) and get an output (joint angle values). I'd like to utilize this aspect of MoveIT (version 1) ...
Noideas's user avatar
  • 11
0 votes
1 answer
69 views

double free or corruption (out) error with PCL

System used: ROS2 foxy on Ubuntu 20.04 with PCL 1.10 installed on amd64 architecture. I have created a C++ subscriber for ROS2 topic velodyne_points of the message ...
user avatar
0 votes
1 answer
121 views

std_srvs not found in ros2

I want to include a service from std_srvs like I do in the beginning in my C++ Code: #include "std_srvs/srv/SetBool.hpp" in my CMakeLists.txt I included ...
user avatar
0 votes
1 answer
13 views

[ROS2] node names relation between launch file and executable

Hi there, this might be a basic question but thus far I haven't found specifics in the docs or tutorials. What is the actual relation between node names specified within the launch file and the ...
user avatar
0 votes
1 answer
25 views

ros2 logging - filtering by log name via executable arguments

Lets say we have two different loggers in the same program and node. Logger l1 = rclcpp::get_logger("l1"); Logger l2 = rclcpp::get_logger("l2"); ...
Pablo Iñigo Blasco's user avatar
0 votes
1 answer
64 views

error: ‘options’ does not name a type

Hello, I am using ROS 2 Galactic on Ubuntu 20.04. I am trying to create a callback group using the tutorial on ROS2 documentation. I am getting this error ...
user avatar
0 votes
1 answer
11 views

TF2-Eigen 3.4 compatibility

I'm working in a quite big project in ROS 1, Noetic. In this project, some code need Eigen 3.4.9. However, some other code needs tf2, including eigen conversions. When compiling with both of them, I ...
user avatar
0 votes
1 answer
38 views

Cartesian path won't achieve full trajectory

Hi, Using this code: ...
user avatar
0 votes
0 answers
25 views

orocos ros integration, createStream causes execution to stuck in a loop

I'm integrating orocos with ros, basically i created a component that read data from some input ports and write on output ports that create streams, because i want to public this values on ros topics ...
DarioZ's user avatar
  • 11
0 votes
1 answer
84 views

How do you generate a motion plan from moveit_msgs::MotionPlanRequest and moveit_msgs::MotionPlanResponse?

I am trying to use the Pilz Industrial Motion Planner in a C++ node and the tutorials claim that it uses moveit_msgs::MotionPlanRequest (and Response) but I haven't ...
user avatar
0 votes
1 answer
164 views

Unable to link ros::package::getPath

I'm trying to do the same as this example : https://answers.ros.org/question/39523/rospackagegetpath-problem/ The function is documented here : http://docs.ros.org/en/jade/api/roslib/html/c++/...
user avatar
0 votes
1 answer
138 views

Getting the rclcpp::Duration in microseconds

Hello everyone! I am trying to calculate the time it takes for a single message from one Node to get to the other Node. The way I calculate the difference is by substituting the timestamp of the ...
user avatar
1 vote
1 answer
98 views

Inverse kinematics with curve constraints

I must calculate the inverse kinematics of a machine in which one of the joints is constrained to a curvilinear path. I looked for existing libraries to model the problem, but none of them seems to ...
iab's user avatar
  • 11
0 votes
2 answers
600 views

Calling external ROS service from C++ code

How can I call a ROS-service that was neither written nor published by me from within C++ code? I see the service listed when using rosservice list, which shows me ...
marc wellman's user avatar
0 votes
1 answer
79 views

Actions example server for MicroRos Arduino

Hello, Is the 'action's (vs publisher/subscriber and 'service' server/client) ready for use in MicroROS for Arduino? Is "https://github.com/micro-ROS/micro-ROS-demos/blob/galactic/rclc/...
user avatar
0 votes
1 answer
7 views

How to have random number every node run

Im using this rand() function on my code. When I first run the node, it gives me random number, but when I run the node again, it gives me the previous random number. I applied this code on turtlesim/...
user avatar
0 votes
1 answer
2k views

PointCloud2 parse to xyz array in ROS2

I'm trying to find a solution of converting PointCloud2 message data into xyz array for further analysis. Though, in my case I'm interested only in 2d application. The information is either scarce or ...
nigeno's user avatar
  • 15
0 votes
1 answer
148 views

How to cancel ros2 action with ros2 cpp action client

Pleas provide ros2 cpp example client to cancel actions Originally posted by anadgopi1994 on ROS Answers with karma: 81 on 2022-03-09 Post score: 1
user avatar
1 vote
1 answer
460 views

ROS2: How to publish cv Mat image?

I'm having trouble understanding how to publish a cv::Mat image in C++, and I can find very little documentation about this. Here's my publish code. I based it on this tutorial: https://docs.ros.org/...
user avatar
0 votes
1 answer
5 views

How to access complex rosmsg elements in cpp?

I trying to access osrf_gear::Order message elements within orderCallback scope. The structure of the message is as following: <...
user avatar
1 vote
1 answer
642 views

Nvidia Jetson Nanon GPIO c++ direct memory interfacing

Is there's any library to interface the Jetson Nano GPIO? There's the official Python interface, and there is an unofficial c++ interface which is working through the filesystem, and I'm interested in ...
Mercury's user avatar
  • 133
0 votes
0 answers
77 views

I'm controlling a stepper motor with GPIO pins with a for loop in C++. If I add a sensor reading to the for loop the motor gets slow, loud, and jerky

I have a C++ script actuating a motor and getting an accelerometer sensor reading every 20th or so pulse to the stepper motor. My problem is that the sensor readings are interrupting the pulses. ...
Ant's user avatar
  • 133
2 votes
1 answer
4k views

Creating a custom msg in ros2

I have a package with two nodes, that are communicating internally. For that reason I would like to create a custom msg to transfer data between them. I've followed this tutorial, which basically sets ...
Mercury's user avatar
  • 133
0 votes
1 answer
4 views

roscpp: Node doesn't stop totally

Hello everyone, I am trying to exit my C++ node correctly but the process doesn't exit totally, here's the log I get : ...
user avatar
0 votes
1 answer
36 views

ros publisher not publishing in debug

Hi I'm running my node in debug (vscode) and getting weird results. I have a loop which is publishing to a motor ...
user avatar
0 votes
1 answer
59 views

Connect to multiple namespaced movegroups from single C++ node

I am working on a two robot set up that uses SMACC state machines in C++, with MoveIt!. In order to control multiple robots from a state machine, I need to run the state machine in a node that is ...
sniegs's user avatar
  • 50
0 votes
1 answer
245 views

LINK : fatal error LNK1104: cannot open file 'm.lib'

I am trying to compile the old PR2 libraries to run on ROS on Windows 10 with Visual Studio 19. One of the dependencies ivcon fails to compile giving the following ...
user avatar
0 votes
1 answer
1 view

Code is not visible in tutorial "Writing a Subscriber for gpsd_client (C++)"

Hello there, I was going through a tutorial on using the gpsd_client package but then stumbled upon a problem regarding the code. Unfortunately I can't see the code included in the tutorial, due to ...
user avatar
0 votes
1 answer
4 views

rostipic echo doesn't work because of a md5sum problem

Hi, I am playing a bag file and I typed rostopic echo /nav_status to see the actual messages but this error message appears. What's going on? I saw other similar questions but I don't understand them. ...
user avatar
1 vote
1 answer
558 views

How to republish odometry in different frame?

I have navigation Odometry, but its some how not in the robot body frame. The odometry is being published in world frame, so its not correct. So i need to transform in the robot body frame as that how ...
bob's user avatar
  • 167
4 votes
1 answer
349 views

Does a stable library exist for docking robots using images?

I built a mobile base from scratch, and now I am focused on getting the robot to charge. The robot is using an on-board webcam (and PC) to detect a QR barcode on the charger unit. Using OpenCV I find ...
Mike's user avatar
  • 361
2 votes
1 answer
857 views

How to use Quaternion from IMU to get the transformation to inertial reference frame?

Im trying to get the Linear Velocity integrating the acceleration from IMu. I know there will be accumulated error due to integration bit before the integration I have to do couple of other steps. ...
bob's user avatar
  • 167
2 votes
1 answer
760 views

C++ (ROS node) for Euler Integration to estimate Velocity knowing the acceleration

Hi I have IMU reading and would like to estimate the linear Velocity knowing the linear acceleration from the IMU using the Euler method. Im aware of the accumulated error. So need a C++(python) code ...
bob's user avatar
  • 167
0 votes
2 answers
848 views

Publisher and subscriber in one ROS node error

I`m doing some underwater UUV Gazebo simulation and would like to use the hector_pose_estimation package to fuse IMU and Fluid pressure sensors input for pose ...
bob's user avatar
  • 167
0 votes
1 answer
693 views

How to do transformation to get correct linear velocity from linear acceleration IMU data?

I have IMU sensor that gives me the raw data such as orientation, Angular and Linear acceleration. Im using ROS and doing some Gazebo UUV simulation. Furthermore, I want to get linear velocity from ...
bob's user avatar
  • 167
0 votes
0 answers
105 views

IK Jacobian is always a singular matrix

I am trying to solve an inverse kinematics equation for 6DOF system, 3 rotation and 3 prismatic joints. I am trying to solve using perturbation method, by adjusting each joint and calculating the ...
Mich's user avatar
  • 101
0 votes
2 answers
92 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
1 answer
31 views

Unable to transform object from namespaced frame 'ns/base_link' to planning frame 'base_link'

I have a two robot system that is prefixed in separated namespaces so each robot can work independently, but they exist in a single workspace in a connected tf_tree....
sniegs's user avatar
  • 50
0 votes
1 answer
1 view

Problem with assigning different colors to segments in PointCloud

Hello, I am trying a segment tracking algorithm. Right now I have 2 segments. I am coloring each segment with different RGB values, pushing the segments into output_cloud which is pcl::PointCloud2pcl::...
user avatar
0 votes
1 answer
10 views

How to send rosservice call message from a c++ package?

Hello all, I am writing a package written in c++ for ros-melodic on ubuntu 18.04. I need to send service call to a node that takes 3 values as following service call from terminal to change LED color. ...
user avatar
0 votes
1 answer
3 views

MessageFilter ApproximateTime doesn't call callback function

Hello, I'm trying to implement MessageFilter in a class. I'm using ROS1 Melodic on Ubuntu 18.04. The code compiles without any errors but when I play my bag file, the callback function aren't called. ...
Mehmet Emin's user avatar
0 votes
1 answer
24 views

tf2 tutorial: follower turtle makes circles, doesn't follow leader

Hello all. I was following the TF2 tutorial and reached the listener part. I have implemented the code accordingly but I noticed my outcome is very different than the one shipped with : ...
user avatar
0 votes
1 answer
24 views

What's the difference between getEulerYPR, getEulerZYX and getRPY?

Hello everyone, I noticed tf::Matrix3x3 provides 3 distinct methods (getEulerYPR, getEulerZYX...
user avatar
0 votes
1 answer
1k views

Modifying Turtlebot3 to include different camera

I'm new to robotics in ROS. I've been learning about ROS and Gazebo using turtlebot (not turtlebot3 actually) on the platform The Construct. I would now like to incorporate turtlebot3 into my project. ...
John Brown's user avatar

1 2
3
4 5
17