Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all 475 articles
Browse latest View live

exclude some topics from rosbag play

$
0
0
I have a bag file with a bunch of topics inside of it, is it possible to *exclude* some topics from being played back? For example, the bag file might have: topics: /camera/depth/image 150 msgs : sensor_msgs/Image /camera/rgb/image_color 150 msgs : sensor_msgs/Image /joint_states 2500 msgs : sensor_msgs/JointState /rosout 35 msgs : rosgraph_msgs/Log /rosout_agg 35 msgs : rosgraph_msgs/Log /tf 7697 msgs : tf2_msgs/TFMessage And I might be interested in playing back everything **except** the `/tf` topic. Is there a shorter way than `rostopic play file.bag --topics ` with all topics?

Playback issues with large rosbag files

$
0
0
Hi, I'm running into issues playing back large rosbag files (> 1GB, they are bags generated of the KITTI dataset using this tool https://github.com/tomas789/kitti2bag for those that are interested). The overall performance (particularly the tf) performance varies greatly, and is particularly poor the first time the bag is played. I suspect that the bag needs to be loaded into memory / cache for proper behavior. I am playing the bags using sim time set to true and the clock option for rosbag play (the issues remain with the options off too). Does anyone have ideas about the causes and fixes/workarounds? Thanks!

TF_OLD_DATA ignoring data from the past for frame openni_depth_optical_frame

$
0
0
Hi, I need to play my bagfile with the -l loop parameter. However after the time is reset, I get a lot of these errors: Warning: TF_OLD_DATA ignoring data from the past for frame openni_depth_optical_frame at time 1.30503e+09 according to authority unknown_publisher Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained at line 260 in /Users/usr/ros_catkin_ws/src/geometry_experimental/tf2/src/buffer_core.cpp According to that wiki entry, one would send an Empty message the topic /reset_time. However, it seems that this topic has been removed a long time ago. What is the currently recommended way to deal with this time reset problem?

Display messages from rosbag

$
0
0
Hey, I want to display the data in some messages from different rosbags. I don know what kind of messages each rosbag has but I want to be able to check that. And then be able to choose which message to display in a graph. My plan is to choose message from a GUI which I will design in QT. But I have problem with reading the data from rosbags messages without knowing exactly what every rosbag contains. Does anyone know how to approach this? (And I am new to ros (that you might have guessed) so please keep it simple).

Best way to add a topic to an existing rosbag?

$
0
0
What would be the best way to add a topic to an existing rosbag? Play the bag and publish the topic while doing a rosbag record -a? Thanks!

No matching constructor for rosbag::View

$
0
0
Hi guys, I am trying to follow the rosbag API guideline to create a rosbag viewer as follows: > rosbag::View view(myBag, rosbag::TopicQuery("velodyne_points")); but I am getting a "No matching constructor" error message. Could you please help me to sort this problem? Thank you!

how to play bag files from c++ or python class

$
0
0
At the moment I'm reading bag files and publishing back the results: bag = rosbag.Bag('2017-09-04-16-11-56.bag') rospy.init_node('talker', anonymous=True) rate = rospy.Rate(0.5) # Not sure what this should be set to pub = rospy.Publisher('cmd_vel', Twist, queue_size=10) for topic, msg, t in bag.read_messages(topics=['cmd_vel']): pub.publish(msg) rate.sleep() But this is not the same as playing back the data since **it does not take into account the time difference between each message.** In this answer (https://answers.ros.org/question/144646/how-to-play-rosbag-file-from-node/) the poster included their solution which as far as I can tell, just publishes all the messages to a topic. So now the only thing I can think of is to go look through the source code of the player.cpp and see how they are publishing rosbag messages at the same rate at which they were recorded (https://github.com/ros/ros_comm/blob/indigo-devel/tools/rosbag/src/player.cpp) Is there a better way?

How to Detect Subscriber Drops a Message

$
0
0
I made a subscriber which reads LIDAR data from rosbag-play. I use C++(roscpp). But when I do rosbag-play with normal speed, subscriber's callback function cannot catch up with LIDAR stream speed, then subscriber's queue become easily full, and many data is dropped and algorithm doesn't work properly. So I have to control the speed of rosbag-play, and to decide appropriate speed, I need to know whether subscriber is dropping data or not. How can I detect that ? (Making queue-size very big is not my choice, because it's just a matter of time until the queue gets full...) (I googled about this question and expected someone already answered, but I could not find any concrete solutions) Thank you for your time, in advance. --- Best regards, Nanoha.

TF_OLD_DATA ignoring data from the past for frame base_footprint

$
0
0
I am new in working with Turtlebot 3 and ROS. I am working with TurtleBot 3-Burger (Rasberry Pi 3) and ROS Kinetic. I have a lunch file to lunch all my necessary nodes. When I run the lunch file in the workstation PC, I will get this error: Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 26.5 according to authority unknown_publisher Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained at line 277 in /tmp/binarydeb/ros-kinetic-tf2-0.5.16/src/buffer_core.cpp I run `roscore` on the workstation PC and run `roslaunch turtlebot3_bringup turtlebot3_robot.launch` on robot PC. Then, I launch mt launch file. My launch file code:

Extract robot position from rosbag

$
0
0
I recorded tf-messages (while driving the robot) into a bagfile and wrote a ros node that should extract the positions (base_link-frame) from that bag file. My idea was to use a tf::Transformer and feed it with all the transforms stored in the tf-messages: rosbag::Bag bag; bag.open("tf.bag", rosbag::bagmode::Read); std::vector topics; topics.push_back("/tf"); rosbag::View view(bag, rosbag::TopicQuery(topics)); tf::Transformer transformer; BOOST_FOREACH(rosbag::MessageInstance const m, view) { //instantiate bag message tf::tfMessage::ConstPtr tfPtr = m.instantiate(); BOOST_FOREACH(geometry_msgs::TransformStamped const tfs, tfPtr->transforms) { tf::StampedTransform stampedTf; tf::transformStampedMsgToTF(tfs, stampedTf); //setTransform returns true! transformer.setTransform(stampedTf); ... } } The method setTransform(...) always returns true, so I thought that it works... Each time I get a transform with child_frame == /robot_1/base_link I want to get the map-base_link-transform at the time of this last transform. But the transformer returns false: if(transformer.canTransform(baseLink, mapFrame, stampedTf.stamp_)==true){ //lookup transform transformer.lookupTransform(baseLink, mapFrame, stampedTf.stamp_, temp); } A few additional facts: The transformer's latest common time is always = 0: transformer.getLatestCommonTime(baseLink, mapFrame, time, NULL) And printing all tf-messages of the bag shows that the tf-tree should be consistent (I'm using stage and used view_frames): /map -> /robot_1/odom -> /robot_1/base_footprint -> /robot_1/base_link -> /robot_1/base_laser_link Is something wrong with my code or idea? Any suggestions for a better solution? Thanks in advance!

using tf data from bag files

$
0
0
I'm wondering if there is a good way to get transforms (rotation and translation) from tf data recorded in bag files. I'm working in python and I don't want to replay the bag file as part of the solution. Instead I want to be able to get other messages from the bag file and use tf to find the euclidean distance between two frames on the robot at the same time instant as my message of interest. Any thoughts? I could look at parent-child relationships in a single tf message and string the transforms together, but then I'd be recreating the functionality of tf. Is there a utility or tool for getting a transformation from a single tf message (i.e. not using ROS to wait for transform or having to replay the bag file). Thanks a lot for any ideas.

How to remove a TF from a ROS bag?

$
0
0
I have a bag that contains a large TF tree where one TF (base_link->virtual_cam) was calculated based on several TFs and parameters. I would like to replay this bag without this generated TF in order to interactively re-generate it as a play the bag. Hence the question, how do I remove this TF from the bag? Alternatively, can I play the bag without outputting this TF? Specs: Ubuntu 12.04, Fuerte

Rosbag python timestamp read

$
0
0
Hello guys , I have the following function: import rospy, time import rosbag def test_function(self, topics_dict, start, stop): bag = rosbag.Bag('test.bag') topic_msg_list = [] startTime = rospy.Time.from_sec(start) print starTime stopTime = rospy.Time.from_sec(stop) print stoPime for topic, msg, rb_tmstmp in bag.read_messages(topics_dict, start_time=startTime, end_time=stopTime): print "im in" for msg_to_check in topics_dict.get(str(topic)): print msg I use it like the following: rb.test_function({'/topic': ['message']}, 1502709999.42, 1503000000.61) But i never get to see the printed output even the 'im in'. What is the problem with the timestamps? Thanks

rosbag how to slow rate

$
0
0
I would like to slow the rate for rosbag file. I tried the following but does not seem to work. Any idea how to do this? rosbag play --rate .5 rgbd_dataset_freiburg1_xyz.bag

rosbag reindex / fix result in empty bag file.

$
0
0
Hi to all, I'm facing with a problem in recovering one bag file marked as `*.active`. I have tried to execute the sequence reindex / fix, none of them fails, but the resulting `.bag` file is empty. Can someone give me some hints?

How to use PCL Kinfu with a rosbag

$
0
0
Hi, I have a rosbag file recorded on a R400 camera (not Kinect) and I want to use PCL Kinfu to generate 3D reconstruction from the recording. Do I need to convert the rosbag file to a Kinect stream? is it even possible? or is there another way to do what I want? Thanks!

create rosbag from image file for stereoimages

$
0
0
hi all, i have a file that content's is left and right images that take from two usb cameras. i want create rosbag from this file for publish stereo images with topics: left/image_raw (sensor_msgs/Image) right/image_raw (sensor_msgs/Image) left/camera_info (sensor_msgs/CameraInfo) right/camera_info (sensor_msgs/CameraInfo) . please help me

Import error catkin_pkg while importing rosbag, roslib and rospy

$
0
0
I am novice to ROS and I followed the ROS installation tutorial to install ROS kinetic. After installing, I open python to import rospy, roslib and rosbag, but it throws the following error:> import roslib Traceback (most recent call last): File "", line 1, in File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/__init__.py", line 54, in import roslib.stacks File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/stacks.py", line 46, in import roslib.packages File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/packages.py", line 49, in from catkin.find_in_workspaces import find_in_workspaces as catkin_find File "/opt/ros/kinetic/lib/python2.7/dist-packages/catkin/find_in_workspaces.py", line 36, in from catkin_pkg.packages import find_packages ImportError: No module named catkin_pkg.packages I again installed catkin_pkg using the following command but nothing happened: sudo apt-get install --reinstall python-catkin-pkg Can anyone suggest me where I am going wrong?

Issue to export images from rosbag file

$
0
0
I'm recording images from /camera/image_raw to rosbag file but when I want to extract them I get gray images with little squares like a grid on them: ![image description](/upfiles/15092920005375726.png) I tried command line and launch file to record: rosbag record -O subset /camera/image_raw and launch file to extract the images but I get the same thing: I can visualize the images from the topic while they're publishing and I can see the RGB image correctly

Does rosbag c++ api write to memory or disk?

$
0
0
I am writing a ROS node that triggers rosbags using a service. I am trying to decide between using rosbag c++ api vs running rosbag record command using command line from my c++ code. It is required that rosbag data is written to disk directly rather than first stored in memory and then store on disk after recording is stopped. Thanks in advance.
Viewing all 475 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>