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

Rosbag Record in Launch File to run_id Log location

$
0
0
Hi, i m just trying to record a .bag for one Topic in a ros .launch File to the log folder of the run_id. to record is no problem but i want that it ll be recorded directly to the folder where it also saves the .log files from the started nodes. If i start a Node in the launch file all logs are written to ` /.ros/log/run_id/` e.g. `/.ros/log/75232c28-d176-92d8-00032d18db0a` thats changes for every new start of roslaunch now i want that the bag file is also saved in this log folder with `` i only can record to /.ros/ can anyone help me on this launch problem? thanks René

Viewing sensor_msgs/Image while using rosbag API

$
0
0
I'm using the rosbag API to sequentially process messages in a bag file. Some of these messages are images (of the type `sensor_msgs/Image`). Is there an image viewing package that has an API that allows me to pass it an image of that type, and it will show the image? More specifically, I'm looking to do this: // Specify topics to be read std::vector topics; topics.push_back(imu_topic); topics.push_back(camera_topic); rosbag::View view(bag, rosbag::TopicQuery(topics)); // Loop through messages BOOST_FOREACH(rosbag::MessageInstance const m, view) { if (m.getTopic() == camera_topic) { sensor_msgs::Image::ConstPtr image = m.instantiate(); if (image != NULL) { // CALL A FUNCTION TO VIEW IMAGE } } }

Error: "Unable to convert 32FC1 image to bgr8" while extracting rbg(d?) data from a bag

$
0
0
I'm trying to extract messages of the "/camera/depth_registered/image_rect" topic from my bag: [ankur@eng050194 20130405]$ rosbag info 20130405_navtest_0.bag path: 20130405_navtest_0.bag version: 2.0 duration: 58.8s start: Apr 05 2013 15:32:07.42 (1365136327.42) end: Apr 05 2013 15:33:06.25 (1365136386.25) size: 3.3 GB messages: 17410 compression: none [3286/3286 chunks] types: sensor_msgs/Image [060021388200f6f0f447d0fcd9c64743] sensor_msgs/Imu [6a62c6daae103f4ff57a132d6f95cec2] sensor_msgs/JointState [3066dcd76a6cfaef579bd0f34173e9fd] sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369] topics: /base_scan 1178 msgs : sensor_msgs/LaserScan /camera/depth_registered/image_rect 1626 msgs : sensor_msgs/Image /camera/rgb/image_rect_color 1658 msgs : sensor_msgs/Image /joint_states 5883 msgs : sensor_msgs/JointState /tilt_scan 1182 msgs : sensor_msgs/LaserScan /torso_lift_imu/data 5883 msgs : sensor_msgs/Imu [ankur@eng050194 20130405]$ I've written up a launch file as described in the tutorial [here](http://www.ros.org/wiki/rosbag/Tutorials/Exporting%20image%20and%20video%20data): However, when I run the launch file, it errors out: [ankur@eng050194 20130405]$ roslaunch exportImageData.launch ... logging to /home/ankur/.ros/log/c113647a-9feb-11e2-b9c4-24be051362b4/roslaunch-eng050194.eng.uts.edu.au-32061.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://eng050194.eng.uts.edu.au:60100/ SUMMARY ======== PARAMETERS * /rosdistro * /rosversion NODES / extract (image_view/extract_images) rosbag (rosbag/play) ROS_MASTER_URI=http://localhost:11311 core service [/rosout] found process[rosbag-1]: started with pid [32095] process[extract-2]: started with pid [32096] [ INFO] [1365387639.215633458]: Initialized sec per frame to 0.100000 [ERROR] [1365387644.328011223]: Unable to convert 32FC1 image to bgr8 [ WARN] [1365387644.328120105]: Couldn't save image, no data! [ERROR] [1365387644.329480639]: Unable to convert 32FC1 image to bgr8 [ERROR] [1365387644.393881439]: Unable to convert 32FC1 image to bgr8 [ERROR] [1365387644.423329040]: Unable to convert 32FC1 image to bgr8 [ERROR] [1365387644.454279657]: Unable to convert 32FC1 image to bgr8 [ WARN] [1365387644.454386746]: Couldn't save image, no data! [ERROR] [1365387644.487755386]: Unable to convert 32FC1 image to bgr8 Would someone know what I'm doing wrong? I extracted the images of the "/camera/rgb/image_rect_color" topic just fine using this approach. Could be related: I can't view these images using rqt_bag either. Am I missing some package that provides this capability?

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?

Renaming a topic inside a bag file

$
0
0
When we record a bag file for example X.bag and it contains the topic data /a_topic Is there any way to rename the topics name inside the X.bag /a_topic to /b_topic? Best regards..

How to extract timestamp from a bag file ?

$
0
0
Hi, I checked on the API c++ but I wasn't able to do what I want. Actually, I would like to write a little program which take an input a bag file and then obtain the the timestamp of each frame as an output. All the timestamp are stored in the /camera_topic. So far what I did is the following: rosbag::Bag bag; bag.open("mybag.bag", rosbag::bagmode::Read); rosbag::View view(bag, rosbag::TopicQuery("/camera_info")); foreach(rosbag::MessageInstance const m, view) { std_msgs::String::ConstPtr s = m.instantiate(); if (s != NULL) ASSERT_EQ(s->data, std::string("foo")); std_msgs::Int32::ConstPtr i = m.instantiate(); if (i != NULL) ASSERT_EQ(i->data, 42); } bag.close(); Is anyone can help me ? Maybe there is another easy way to do that stuff (bash ?) but It would be great using c++. Thank

converting serial time from bag file in matlab

$
0
0
I recorded a bag file and then I used a ros package to read the data in matlab. the time datta are saved in serial number and I didnt knew how to convert it to real time or into informative time. How can I solve this problem?

Converting a bag with uncompressed Images to CompressedImages

$
0
0
I have an offline program that will bag.write sensor_msgs/Image and would rather compress them into a smaller format (e.g. JPEG) for easier streaming. Compressing the bags with bz2 or lz4 is insufficient. How do I do this offline (without using compressed image transport and publishing/subscribing) in C++ (for initial creation) and/or Python (post processing script on existing bags)?

Exception thrown while processing service call: Time is out of dual 32-bit range

$
0
0
I am doing a very simple implementation of ROS service. There are two nodes, server and client node and the only main variable is that I am using rosbags for streaming data used by callback method on server side. I am getting the following error on some callbacks - Exception thrown while processing service call: Time is out of dual 32-bit range Can someone throw some light on why am I getting this error and how can I fix this for my service callback to work properly?

start and stop rosbag within a python script

$
0
0
Hi, I wrote an Action Server which gets all topics I want to record via the goal. Everything works fine until i want to stop rosbag. With my script i can start rosbag out of my script and i can see the bag-file which is generated. But when i want to kill the rosbag process out of my script, rosbag doesn't stop. It doesn't stop until i stop my whole ActionServer. But the action server should still run after stopping rosbag. Here is the code I wrote: (the topic_logger.msg includes the goal, an id and an array of topics) #! /usr/bin/env python import roslib; roslib.load_manifest('topic_logger') import rospy import subprocess import signal import actionlib import topic_logger.msg class TopicLoggerAction(object): # create messages that are used to publish feedback/result _feedback = topic_logger.msg.topicLoggerFeedback() _result = topic_logger.msg.topicLoggerResult() def __init__(self, name): self._action_name = name self._as = actionlib.SimpleActionServer(self._action_name, topic_logger.msg.TopicLoggerAction, execute_cb = self.execute_cb) self._as.start() rospy.loginfo('Server is up') def execute_cb(self, goal): if goal.ID == "topicLog": # decide whether recording should be started or stopped if goal.command == "start": #start to record the topics rospy.loginfo('now the topic recording should start') args = "" for i in goal.selectedTopics: args = args + " " + i command = "rosbag record" + args self.p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=True, cwd=dir_save_bagfile) rospy.loginfo(self.p.pid) # process = p # print p.stdout.read() # check if the goal is preempted while 1: if self._as.is_preempt_requested(): rospy.loginfo('Logging is preempted') self._as.set_preempted() break elif goal.command == "stop": #stop to record the topics rospy.loginfo('now the topic recording should stop') #self.p.send_signal(signal.SIGTERM) rospy.loginfo(self.p.pid) killcommand = "kill -9 " + str(self.p.pid) rospy.loginfo(killcommand) self.k = subprocess.Popen(killcommand, shell=True) rospy.loginfo("I'm done") #while 1: # if self._as.is_preempt_requested(): # rospy.loginfo('Logging is preempted') # self._as.set_preempted() # break else: rospy.loginfo('goal.command is not valid') else: rospy.loginfo('goal.ID is not valid') if __name__ == '__main__': rospy.init_node('topicLogger') dir_save_bagfile = '/home/ker1pal/' TopicLoggerAction(rospy.get_name()) rospy.spin() Are there any ideas why I can't stop rosbag out of my script without killing my whole ActionServer ? Thanks Ralf

How to read the names of recorded topics in a rosbag?

$
0
0
Hello, I know there is a rosbag C++ API, but I don't seem to find in it a simple function which returns for example an std::vector of std::strings specifying the names of the topics recorded in that bag :s Anyone knows how to do that?

rosbag info in C++

$
0
0
I need to get the names of all the topics in a rosbag in C++ (that is using something like rosbag API). The rosbag [cookbook](http://www.ros.org/wiki/rosbag/Cookbook) mentions how to get information about the rosbag using python but not C++. Any help would be appreciated.

How to pass an argument to roslaunch file from shell script?

$
0
0
I have a shell script that takes some input from the user in the form of arguments and executes a launch file with some nodes. One of these nodes is a `rosbag record`. Currently, I have hardcoded the output directory for the recorded bag, but I'd like to parametrize this and let the user decide where to store the folder from the shell script. I start the node like this at the moment: `` I cannot figure out how to to pass this `args` from a shell script. Any ideas? it should be possible...

Problem with rosbag and rviz using laser scanner data

$
0
0
Hi guys, I’m trying to use rviz to read this laser scanner sampled data (http://classes.engineering.wustl.edu/cse550/data/Mapping1.bag) , using rosbag play. I add a display that reads the /base_scan topic and i visualize data on the grid, but in the terminal i get this error: [ WARN] [1434533618.305097862]: MessageFilter [target=map ]: Dropped 100.00% of messages so far. Please turn the [ros.rviz.message_notifier] rosconsole logger to DEBUG for more information. What does it mean and how could i solve it? Then, i’d like to use the gmapping node to read the same sample data from the /base_scan topic. When i launch the gmapping node i get this error: [ WARN] [1434533924.754354892]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information. I noticed that the gmapping node needs also to read the /ft topic to work properly, but that topic is not published when i run rosbag play Mapping1.bag, so it’s empty. Is it a problem? How can i manage it? Thank you very much, Flavio

what makes rosbag to start playing fast?

$
0
0
When you start robag play with huge bag files or a lot of bag files for the first call usually is takes some time until rosbag actually starts publishing. For repeative calls then it starts publishing quite fast, until something I don't know (reboot?, unmount bag storage device? timeout?) happens. I guess rosbag caches an index file somewhere to make repeative plays faster. What causes it to discard this index file? Is there a way to store this index file and point rosbag play to it in other for speeding up play e. g. first time after system boot?

How to use lsd_slam using png files not bag file?

$
0
0
I use fuerte and ubuntu 12.04. I install lsd_slam code and try to run it. Firstly, I run below command : fuerte_workspace$ roscore fuerte_workspace$ rosrun lsd_slam_viewer viewer fuerte_workspace$ rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info fuerte_workspace$ rosbag play LSD_room.bag LSD_room.bag file was downloaded from [here](http://vision.in.tum.de/research/lsdslam?redirect=1). If I want to use png files, how can I run this example? Should I convert png or video to bag file?

how bagfile avoid to be rewritten

$
0
0
When I try to use bag file to store data, I find the bag file only store the data that I write last time. Last time means the last time to open the bag file and write data. Anybody knows how to add data to bag file?

unable to extract images from bag file

$
0
0
http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data I am following this tutorial. after I did roslaunch export.launch, "" [rosbag-2] process has finished cleanly log file: /home/krish/.ros/log/2e6402e2-2086-11e5-8d8c-0026c72b65a2/rosbag-2*.log""" this is the message i got I did ctrl+c moved this file into test directory. but I can;t see any images here Also, i actually want to extract stereo images. when I do rosbag info, I get: """ types: sensor_msgs/Image [060021388200f6f0f447d0fcd9c64743] topics: /rrc_camera/left/image_raw 171 msgs : sensor_msgs/Image /rrc_camera/right/image_raw 171 msgs : sensor_msgs/Image"""

roslaunch not working

$
0
0
http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data I am following this tutorial to export images from a bag file. in `src` in catkin workspace, I created a new package `myimage`. created a folder `launch`, and copy-pasted `export.launch` in that folder. I then, did `roslaunch export.launch` and I got the error message: Unable to contact my own server at [http://192.168.1.4:43535/]. This usually means that the network is not configured properly. A common cause is that the machine cannot ping itself. Please check for errors by running: ping 192.168.1.4 For more tips, please see http://www.ros.org/wiki/ROS/NetworkSetup I have tried this: http://answers.ros.org/question/10238/unable-to-contact-my-own-server/ but, it did not help in my case. It is still showing the same error

Extract 60 fps image from bag file

$
0
0
I have a bag file with a 60 fps camera image stream. I want to extract all the image frames. However, even if I specified _sec_per_frame to a very small value, I still got very low fps image files: there should be ~20k images for my 5min bag file, but now I only get ~2k images. Here's the launch file I used:
Viewing all 475 articles
Browse latest View live


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