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?

How to extract depth data from rosbags(contains depth and RGB data) as picture frames

$
0
0
I have a Bagfile containing Raw depth and RGB data. I converted the RGB data into images using the tutorial http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data But when I used the same for converting raw depth to images, I get an error stating " cannot convert 32FC1 to RGB8". This is my launch file: I went through Google for various suggestions given to do the same but I being a beginner find most of the solution vague or misleading and I end up confusing myself. I need to know whether my approach was right or should I do something else? If so what should I do exactly.Please help me through this

Exporting jpegs from bag file skips frames

$
0
0
Hi to everyone, I am following this tutorial to generate a video from a bag file in which I put the frames of a vision sensor: http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data I can go through it without problems but I have one problem. If I do $ rosbag info cameraVisionSensorRecord.bag I get: path: cameraVisionSensorRecord.bag version: 2.0 duration: 1:19s (79s) start: Mar 16 2016 17:26:51.45 (1458145611.45) end: Mar 16 2016 17:28:10.93 (1458145690.93) size: 8.7 GB messages: 1508 compression: none [1508/1508 chunks] types: sensor_msgs/Image [060021388200f6f0f447d0fcd9c64743] topics: /vrep/Vision_sensor 1508 msgs : sensor_msgs/Image This bag file has 1508 msgs inside. When I try to generate the frames like described in the tutorial I get only 604 frames (605 actually, because it start from 0000.jpg): ..................... process[rosbag-1]: started with pid [12579] process[extract-2]: started with pid [12580] [ INFO] [1458145752.700535439]: Initialized sec per frame to 0.100000 [ INFO] [1458145754.630371279]: Saved image /home/**********/Desktop/rosbag/bitmap/frame0000.jpg [ INFO] [1458145754.747831132]: Saved image /home/**********/Desktop/rosbag/bitmap/frame0001.jpg ............................... ............................... [ INFO] [1458148035.459727400]: Saved image /home/**********/Desktop/rosbag/bitmap/frame000602.jpg [ INFO] [1458148035.620177921]: Saved image /home/**********/Desktop/rosbag/bitmap/frame000603.jpg [ INFO] [1458148035.732808217]: Saved image /home/**********/Desktop/rosbag/bitmap/frame000604.jpg [rosbag-1] process has finished cleanly log file: /home/*******/.ros/log/a4201dd0-eb7f-11e5-bfc5-8cdcd4d399a8/rosbag-1*.log I do NOT understand why I am not able to get 1508 frames like in the bag file. Could you explain why this happens? Thanks in advance.

subsampling rosbag images

$
0
0
Hello everyone, I got a problem by coping with the rosbag. I want to evaluate the SLAM performance in wide baseline. I got a rosbag, which is 50fps(frame per second) . The specific task is subsample the rosbag, make the fps to 25 or 20. Is there has some ways to modify the rosbag?

When does rosbag start capturing messages and why I see the delay in two messages?

$
0
0
I am trying to understand how much time it takes for rosbag to start capturing packet as soon as we type `rosbag record -a` . After analyzing packets captured in the wireshark ( see the wireshark packet at https://goo.gl/9kR2WC) , I found that before receiving any messages from ros nodes, roscord subscribers do several packet negotiations with ROS MASTER and then closes the connection to directly connect with rosnode to receive message from them (In enclosed wireshark capture file, packet no. 91 to 314). I want to know that during this packet negotiation, are ros messages buffered and once connection is established they are recorded or during this packet negotiation are ros messages dropped? The reason is my bot publishes position and velocity. Differentiating position should give velocity. When I plot differentiated position and velocity, I find that there is lag of 0.4 second in velocity data and time shifting velocity by 0.4 second matches the differentiated position. Please note that positions and velocity data comes from two different sensor(it means they come from two different ros nodes). My whole point of discussion is to find out the source of the delay or why I need to do time shift in velocity.

How to stop rosbag recording in C++ rather than command line ?

$
0
0
The rosbag::recorder class by default can only stop rosbag recording when the rosnode is shutdown. Is there any change we can make so that the ROS application would start and stop recordings by calling function?

How to use tf_remap??

$
0
0
Hello, I have a rosbag in which a /tf topic is recorded. I need to remap all tf frames in that bag which refer to the frame named '/world' to refer to a new frame named '/vision'. I tried the following but it is unfortunately not working: rosrun tf tf_remap _mappings:='[{old: /world, new: /vision}]' Am I missing something? **EDIT**: I have also tried to do it from a launch file: - {old: "/world", new: "/vision"} but it's not working :( Could it be that I am missing some argument when calling rosbag play? **EDIT 2**: After searching, I found people saying that, in addition to running the tf_remap node, rosbag should be run as follows: rosbag play x.bag /tf:=/tf_old I tried it, and still it's not working :( The tf_frames are still referring to /world rather than /vision. Any help would be highly appreciated!!

Extracting definition of customized messages from bag files

$
0
0
TL;DR: How can write a node that subscribes to topics under customized messages that's published from a bag when I don't have access to the definition of the customized messages (the .msg files)? I have a bag file containing topics in customized messages, for example `dbw_mkz_msgs/SteeringReport`. While I don't have access to the `dbw_mkz_msgs` or the definition of `dbw_mkz_msgs/SteeringReport`, I can use tools such as `rqt_bag` or `rostopic echo -b` to view them (their fields and values to be more specific). I can even use the `rosbag` python api to edit them and write to another bag. However, what I cannot do is write a node that subscribes to one of these topics in `dbw_mkz_msgs/SteeringReport` since I cannot `from dbw_mkz_msgs.msgs import SteeringReport`. Is there a way to extract the definition of a customized message from a bag file?

Does "rosbag record -j" do its compression in the background after ROS shutdown?

$
0
0
I have a Python node that invokes ``rosbag record -j`` to record some topics. * On shutdown, ``rosbag`` returns. * At that point I want to run a script that uploads the bag from the robot to a server. That will take a while, and I don't want to delay shutdown so long. * The node, which is now shutting down, runs the script in the background under a different process group using the Linux ``setsid`` command ([link to code](https://github.com/utexas-bwi/bwi_common/blob/joq/autolog/bwi_logging/src/bwi_logging/logger_node.py#L97)). * Even when I run the script that way, it sometimes stops immediately without copying the expected bag file, which is expected to match ``$prefix_*.bag``. Running the same command afterwards by hand works fine. * Delaying the script from starting seems to make it work more often. The length of delay needed appears to increase with the size of the bag. So, I wonder if ``rosbag record -j`` is running its compression step in the background after ROS shutdown causes it to return. That would explain what I see: the ``$prefix_*.bag`` file does not exist until compression finishes.

Export from rosbag

$
0
0
Hi, I'm recording an ROS bag using [Intel R200](http://wiki.ros.org/RealSense_R200) at 30Hz. Using "rosbag info" I see the right amount of frames(duration*30[Hz]), yet when [exporting the bag to jpeg](http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data)'s, I get only about 8Hz, where I see the correct start and end frames, yet many frames in between are missing. It's very important for me. Any advice?

Rosbag and timestamp received vs timestamp published

$
0
0
I can't find it anymore but I seem to recall reading somewhere that when you record a rosbag, the timestamp encoded to the message is the time at which the message was received by the rosbag record process instead of the time at which it was published. If this is true, is there a way to force a rosbag to instead encode messages with the timestamp which were published with them?

How to subscribe to sensor_msgs/CompressedImage without the raw image?

$
0
0
Recently, I recorded a large set of image data using a rosbag, but I am not able to get the subscriber working for the compressed image topic. I did not save the image_raw topic. I only saved the compressed topic. These are the topics contained in my rosbag file. /usb_cam/camera_info /usb_cam/image_raw/compressed I am able to extract the images from the bag file and save to disk using a command that looks something like this rosrun image_view extract_images _sec_per_frame:=0.001 image:=/usb_cam/image_raw _image_transport:=compressed **I do want to note that the number of /usb_cam/image_raw/compressed messages in my bag file is 16078 and after executing that command the number of images saved to disk is only 16052** Regardless, **the main issue is that I am not able to get the images through a subscriber in any of my nodes**. I am able to get the images in my subscriber in real time using the image_raw topic, but I can't get this to work using only the compressed topic. I have looked at several tutorials, but I am still not able to figure it out. I think I am missing something very simple. Here is my code for the simple subscriber that will not work. class Images { public: image_transport::Subscriber sub_image;these Images() { ros::NodeHandle node; image_transport::ImageTransport it(node); sub_image = it.subscribe("/usb_cam/image_raw/compressed", 1, &Images::imageCallback, this); } void imageCallback(const sensor_msgs::ImageConstPtr& msg) { try { cv::imshow("view", cv_bridge::toCvShare(msg, "bgr8")->image); cv::waitKey(30); } catch (cv_bridge::Exception& e) { ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str()); } } }; int main(int argc, char **argv) { ros::init(argc, argv, "my_node"); ROS_INFO("my_node running..."); Images images; ros::spin(); return 0; } If I run this code I get the following error messages: [ WARN] [1459295416.022612760]: [image_transport] It looks like you are trying to subscribe directly to a transport-specific image topic '/usb_cam/image_raw/compressed', in which case you will likely get a connection error. Try subscribing to the base topic '/usb_cam/image_raw' instead with parameter ~image_transport set to 'compressed' (on the command line, _image_transport:=compressed). See http://ros.org/wiki/image_transport for details. I don't know how to subscribe to '/usb_cam/image_raw' instead because this topic does not exist in my rosbag file. If I do subscribe to '/usb_cam/image_raw', then the callback function never triggers because the topic doesn't exist. How do I do this?

How to get number of messages in one topic from rosbag.py

$
0
0
Hello! I was wondering whether with the Python module rosbag there is any chance to get the number of recorded messages in one topic. The Bag.read_messages method returns a generator and of course I could iterate over all messages and count. But is there a way to tell the number in advance? That way I could preallocate the right amount of lists to handle the messages. Thank you!

Odometry from tf/tfMessage

$
0
0
I'm using gmapping to make the map from a prerecorded Rosbag file, which contains laser and TF topics. I'm able to do the map without any problems. Somehow I need to access the odometry information that was recorded on the Rosbag file to implement one EKF filter, how can I obtain the raw odometry data to use it as a sensor information to fuse it my filter? I am a little bit lost, some help will be useful. Thanks

rqt_bag and rosbag not publishing same messages

$
0
0
Hello, I'd like to visualize a robot performing a specific task. This involves playing a bag file with rqt_bag and visualizing the tf frames in RViz. I load the bag in rqt_bag, publish tf, and set "Play all Messages". The first problem: Playing the bag file in rqt_bag when setting "Play all Messages" is *really* slow. Much slower than playing the bag with rosbag play. This isn't a huge issue. The bigger issue: When visualizing the robot description in RViz the robot is "teleporting" around the space. I looked into this, and found that not all of the tf messages are being published, in spite of setting "Play all Messages". When using rosbag play, this problem doesn't occur. To test this, I subscribed to tf when playing the bag in rqt_bag and rosbag play. I output the messages to two separate files and compare them in Beyond Compare (amazing program FYI). Many messages played in rosbag play don't show up in rqt_bag. Is there a current workaround for this? My suspicion is that rqt_bag not publishing all of the tf messages, but could there be a different source of the issue?

Rosbag record to different path?

$
0
0
Hi all, Is there any way to record rosbag data to a different location than the default location? I am getting the following error: [ERROR] [1460470166.869390414]: Less than 1GB of space free on disk with corridorlocalization_2016-04-12-16-00-06.bag.active. Disabling recording. [ WARN] [1460470167.370142337]: Not logging message because logging disabled. Most likely cause is a full disk. Is it possible to record rosbag data to a pen drive? Thanks

Can you somehow use txt files to make a rosbag?

$
0
0
Hi! With the use of the program Eclipse I get sensordata and encoderdata saved in .txt files after a testdrive with a robot. Is it somehow possible to use these .txt files and convert them together to a rosbag? Or are there other ways to test gmapping instead of a rosbag? Thanks!

.txt file with timestamp to rosbag

$
0
0
Hi I have a txt file with sensordata and a txt file with encoder data. Both have a timestamp. I want to use these to make a rosbag, how is this possible with C++? Thanks

rospy cyclic buffering of topics with timestamps

$
0
0
I have a lot of topics that I want to store in a buffer, but the individual topics shouldn't be recorded for more than 10 seconds each. For a couple of topics this line functions fine, but if I want to subscribe to all topics it starts lagging behind. I need to use something more effective than re-writing a new list, I need to pop all the elements that are older than 10s. `buffer[topic] = [ msg for msg in buffer[topic] if timestamp - msg[0] < rospy.Duration(10.0) ]` Each topics has a timestamp, if this timestamp is larger than 10s we want to remove those elements. Hoping you guys can help.

rosbag playing 100hz lidar data

$
0
0
Hi I'd recorded four lidar(Sick LMS511@100hz,0.67deg) with sicktoolbox_wapper2 and rosbag record(lidar1/scan, lidar2/scan, and so on). Once I tested my code in the lab using rosbag play XXX.bag, I noticed my callback function actually manipulating quadruple data at once! Callback takes not 10ms for each lidar data but it takes 40ms at first data and about 0ms at others. even the program subscribe 1 of 4 lidar data(lidar1/scan). Here is my test code to compare recoded timestamp & callback time ---------- #include #include class laser_rate_test_node{ private: ros::NodeHandle nh; ros::Subscriber laser_sub; public: laser_rate_test_node(ros::NodeHandle _nh):nh(_nh){ laser_sub = nh.subscribe("lidar1/scan",10, &laser_rate_test_node::laserCallback, this, ros::TransportHints().unreliable()); } void laserCallback(const sensor_msgs::LaserScanConstPtr& scan){ ROS_INFO("%lf",scan.get()->header.stamp.toSec()); } }; int main (int argc, char **argv) { ros::init(argc, argv, "laser_rate_test_node"); ros::NodeHandle nh; laser_rate_test_node laser_rate_test_node(nh); ros::spin(); } and its results with network IO graph using wireshark are below: using rosbag play XXX.bag. Highlighted text shows called time(left with bracket) and sensor timestamp(right) ![rosbag_normal](http://imgur.com/ld2X3Ka.png) using rosbag with -i option ![image description](http://imgur.com/gSMM1ci.png) no bag used(using actual sensor), ignore wireshark result... it's same as upper one. ![image description](http://imgur.com/n4POK3U.png) In view of the results, I think this problem is a bug of rosbag play, not my code related with ROSTCP and ROSCPP. How can I handle this problem? Is there anyone who suffered similar problem?
Viewing all 475 articles
Browse latest View live


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