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

recording only header image_raw message

$
0
0
I would like to record using rosbag only the /usb_cam/image_raw/header topic excluding the data. Tried: rosbag record -a -x "/usb_cam1/image_raw/data" But looks like it is not working. I have more topics to include than exclude so just checking for suggestions

How to build a map from a recording with gmapping

$
0
0
I followed [this tutorial](http://wiki.ros.org/cn/slam_gmapping/Tutorials/MappingFromLoggedData) with the rosbag provided in the tutorial. Here is the map it produces: ![image description](https://i.imgur.com/dB8gRe6.png) It looks like it only mapped the first scan. Here is the output from the gmapping node: rosrun gmapping slam_gmapping scan:=base_scan [ INFO] [1551524238.823445558, 124.693134426]: Laser is mounted upwards. -maxUrange 29.99 -maxUrange 29.99 -sigma 0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05 -srr 0.1 -srt 0.2 -str 0.1 -stt 0.2 -linearUpdate 1 -angularUpdate 0.5 -resampleThreshold 0.5 -xmin -100 -xmax 100 -ymin -100 -ymax 100 -delta 0.05 -particles 30 [ INFO] [1551524238.836756704, 124.703192634]: Initialization complete update frame 0 update ld=0 ad=0 Laser Pose= -19.396 -8.33452 -1.67552 m_count 0 Registering First Scan [ WARN] [1551524238.863916087, 124.733375778]: Detected jump back in time of 0.00925415s. Clearing TF buffer. [ WARN] [1551524239.771986838, 125.640838491]: Detected jump back in time of 0.00961792s. Clearing TF buffer. The warning from the last line repeats. What am I doing wrong here? Is it possible to use gmapping with a rosbag that contains just the laser scan and no transform? I use Ubuntu 16.04 and ROS kinetic 1.12.14.

where can I find the video_player launch file for kinetic kame on ubuntu16.04

$
0
0
I need the video player to record an video file and convert it into bag file format. Please help me with that.

Rviz crashes on "ROS time moved backwards"

$
0
0
Hi all, I am using ubuntu 14.04 with ros indigo. I am running rosbag play with --clock --loop, viewing it on rviz with pointcloud scenes I have recorded previously. I subscribe to the message output with another node, running some segmentation scripts I wrote. So, I used to be able to loop through the bagfile, changing parameters on the fly. Every time it looped I would get a warning (actually I think it was en error message) but everything would have kept on going. I'm not sure when it started or what I did to make it so, but now every time I get to the end of the recording (or exit the rosbag and run it again) then I get the same message but Rviz crashes. It consumed a lot of time for me. Does anyone know how to make it so that Rviz does not crash on time moving backwards? Thanks in advance, Steve

enable/disable rosbag recording as a service

$
0
0
I need to enable/disable bag recording on our robot from a remote machine. Ideally as a ROS service. Does anybody have a recommendation for how this could be done? Is there any other good way to remotely selectively enable topic logging for a robot? Ideas appreciated.

AttributeError: 'module' object has no attribute 'Bag'

$
0
0
Program: import time, sys, os from ros import rosbag import roslib, rospy roslib.load_manifest('sensor_msgs') from sensor_msgs.msg import Image from cv_bridge import CvBridge import cv2 TOPIC = 'camera/image_raw' videopath='/Home/' bagname='output1.bag' def CreateVideoBag(videopath, bagname): '''Creates a bag file with a video file''' bag = rosbag.Bag(bagname, 'w') cap = cv2.VideoCapture(videopath) cb = CvBridge() prop_fps = cap.get(cv2.cv.CV_CAP_PROP_FPS) if prop_fps != prop_fps or prop_fps <= 1e-2: print ("Warning: can't get FPS. Assuming 24.") prop_fps = 24 ret = True frame_id = 0 while(ret): ret, frame = cap.read() if not ret: break stamp = rospy.rostime.Time.from_sec(float(frame_id) / prop_fps) frame_id += 1 image = cb.cv2_to_imgmsg(frame, encoding='bgr8') image.header.stamp = stamp image.header.frame_id = "camera" bag.write(TOPIC, image, stamp) cap.release() bag.close() if __name__ == "__main__": if len( sys.argv ) == 1: CreateVideoBag(videopath,bagname) else: print( "Usage: video2bag videofilename bagfilename") bag.close() $ python video2bag.py Error: Traceback (most recent call last): File "video2bag.py", line 39, in CreateVideoBag(videopath,bagname) File "video2bag.py", line 15, in CreateVideoBag bag = rosbag.Bag(bagname, 'w') AttributeError: 'module' object has no attribute 'Bag' Please help me with above error

ROSBag tools for windows

$
0
0
I've noticed most of the toolchain offered by ROS is mostly python, and the most advanced tools seem to be available only for Linux. So I would like to know if there's any command line tool or EXE application for windows for processing / viewing ROS Bag files. Thanks

Formatting rosbag data exported to .csv

$
0
0
I created a Rosbag of turtlesim data and would like to export the x and y coordinates only to a .csv file. Right now, however the formatting is as such: x y x y x y using this command to export to a test .csv file: rostopic echo /turtle1/pose | sed -n '/x:/,/y:/p' > ~/Desktop/test.csv I would like the formatting to be like this: x y x y x y Does anyone know how I would do this?

Formatting ROS data to .csv file

$
0
0
I created a Rosbag of turtlesim data and would like to export the x and y coordinates only to a .csv file. Right now, however the formatting is as such: x y x y x y using this command to export to a test .csv file: `rostopic echo /turtle1/pose | sed -n '/x:/,/y:/p' > ~/Desktop/test.csv` I would like the formatting to be like this: x y x y x y Does anyone know how I would do this?

Understanding rosbag timestamps

$
0
0
Looking at the ROSbag.v2 specification, every message stored in a bag file is comprised of a: 1. Message Header 2. Message Content The header contains a connection ID and a TimeStamp. The content is the message serialized to bytes, which can include a std_msgs/Header.stamp. So, I would like to understand which is the relationship between the bag header TimeStamp and the message's std_msgs/Header.stamp I am also concerned about out of order messages, where messages have been acquired at different times, but they reach the bag file writing queue out of order. Questions: - It is mandatory that both the bag header stamp and std_msgs/Header.stamp to always match? - It is mandatory that the bag header TimeStamp to be in order? - Can the std_msgs/Header.stamp to be out of order and decoupled from bag header TimeStamp? In general, who is usually responsible of handling out of order messages? the software writing the bag files, or the clients reading them? My undestanding is that the bag header TimeStamp is the instanct in which the message is written to the file, so they're guaranteed to be in order. While the message's std_msg/Header.stamp is the acquisition time, which can be a out of order and a bit sooner than the time in the bag header. Is this correct? so for example, I can have a bag file with two consecutive messages, where - The header timestamps are sequential and in order... - But the actual message Header.stamps can be sooner and out of order. Is this right?

Using rosbag to get size of each topic

$
0
0
I'm trying to remove unnecessary topics from a rosbag file to make it easier to distribute. In doing so, i'd like to know the size of each topic, not just the size of the bag file as a whole. However, running `rosbag info example_bag.bag` only provides me with the size of the bag file and not the size of individual topics. Is there any way to use the `rosbag` command line tool to obtain the size of individual topics within the bag file?

TF_OLD_DATA ignoring data from the past, when rosbag twice

$
0
0
Hey everyone, Bascially, I use the rosnode to process rosbag to create my database, and I would like to feed rosbag to this node again, but the node just don't work and have the error msgs, Warning: TF_OLD_DATA ignoring data from the past for frame depth at time 727885 according to authority unknown_publisher Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained According to the link abobe : The fix for this is to send an Empty message the topic /reset_time. There is a button in rviz to do this. But I dont find it in rviz, any help here?

unindexed bag using RQT

$
0
0
Dear all, I recorded a big bag file (around 240MB) using the RQT logging GUI. The publisher nodes are on a robot and the rqt is running on my PC. Due to un emergency I had to close RQT when the record was still ongoing. The bag file was created on my PC anyways, however it is unidexed (i.e. I get the following error when I try to play it rosbag.bag.ROSBagUnindexedException: Unindexed bag). So I followed the trobleshooting and did rosbag reindex which created another bagfile with same dimensions but apparently empty. Is there any way of fixing this problem , the data would be very useful for my research. Please let me now if you need more information from me. Many thanks in advance, Giacomo

"Waiting for the map" when using map_server and rosbag

$
0
0
Hello, I'm currently doing the tutorial [teb_local_planner](http://wiki.ros.org/teb_local_planner/Tutorials) and now I'm trying to build a map with this [tutorial](http://wiki.ros.org/slam_gmapping/Tutorials/MappingFromLoggedData). I execute all commands and at the end of this, I have problem with this command : ~/Documents/pts-info2-master/mybot_ws-base_sensors/src$ rosrun map_server map_saver -f my_map [ INFO] [1553269724.865617557]: Waiting for the map I never get the map and I must kill the process. I use Velodyne, Ubuntu 16.04 with ROS Kinetic distribution. Thanks.

Semantics of `%time` timestamp in `rostopic echo -p` from bagfile?

$
0
0
When I print the topic data using `rostopic echo -p -b filename.bag /topic_name`, there are two timestamps in the output. One comes from the header of the message (third column: `field.header.stamp`), one comes from somewhere else (first column: `%time`). Both have slightly different values, e.g. * `%time`: 1552649896239792539 (2019-03-15 11:38:16.239793), * `field.header.stamp`: 1552649894321638000 (2019-03-15 11:38:14.321638) I didn't find documentation about the first timestamp `%time`. Is it assigned by rosbag to reflect the time of recording? In this case, this would indicate that the message was recorded almost two seconds after the timestamp in the header indicates. Would it be reasonable to make inferences about the latency on the topic like this?

Error in using pyrosbag?

$
0
0
Hello everyone I am trying make a bag file of rgb images and depth images that are saved in .mat file (h5py fomat), in Ubuntu 16.04 and ROS kinetic with pycharm IDE. import pyrosbag import h5py import numpy as np path_to_depth = '/home/maq/PycharmProjects/ROS_bagfile/test.mat' f = h5py.File(path_to_depth) img = f['rgb_undist'][1] img_ = np.empty([480, 640, 3]) img_[:, :, 0] = img[0, :, :].T img_[:, :, 1] = img[1, :, :].T img_[:, :, 2] = img[2, :, :].T img__ = img_.astype('float32') bag = pyrosbag.Bag('test.bag') pyrosbag.BagPlayer.play() But ther is error on the play command, I have taken help from [here](https://pyrosbag.readthedocs.io/en/latest/pyrosbag.html). Error is /usr/bin/python2.7 /home/maq/PycharmProjects/ROS_bagfile/ros_bagfile.py Traceback (most recent call last): File "/home/maq/PycharmProjects/ROS_bagfile/ros_bagfile.py", line 22, in pyrosbag.BagPlayer.play() TypeError: unbound method play() must be called with BagPlayer instance as first argument (got nothing instead) Process finished with exit code 1 Can anyone help me with this or guide me with some other effective method that could be done in pycharm. Regards.

Storing rosbag::Bag in std::vector results in segfault

$
0
0
I am attempting to store some `rosbag::Bag`s in a `std::vector`, but calling: std::vector bags; bags.push_back(rosbag::Bag()); results in the following segfault: #0 0x00007ffff62c7c6d in rosbag::ChunkedFile::swap(rosbag::ChunkedFile&) () from /opt/ros/melodic/lib/librosbag_storage.so #1 0x00007ffff62a7014 in rosbag::Bag::swap(rosbag::Bag&) () from /opt/ros/melodic/lib/librosbag_storage.so #2 0x00007ffff62aef75 in rosbag::Bag::Bag(rosbag::Bag&&) () from /opt/ros/melodic/lib/librosbag_storage.so #3 0x00007ffff7bc0991 in __gnu_cxx::new_allocator::construct (this=0x677608, __p=0x687820, __args=...) at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/ext/new_allocator.h:136 #4 0x00007ffff7bc05cd in std::allocator_traits>::construct (__a=..., __p=0x687820, __args=...) at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/alloc_traits.h:475 #5 0x00007ffff7bc06a5 in std::vector>::_M_realloc_insert (this=0x677608, __position=non-dereferenceable iterator for std::vector, __args=...) at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/vector.tcc:415 #6 0x00007ffff7bc0581 in std::vector>::emplace_back (this=0x677608, __args=...) at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/vector.tcc:105 #7 0x00007ffff7bbcd40 in std::vector>::push_back (this=0x677608, __x=...) at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:954 I have tried to use `std::move` in the `push_back` from a `Bag` object allocated on the stack, but the result is the same (segfault). How can I correctly create a `std::vector` of Bag objects? I am using ROS Melodic on Ubuntu 18.04 on an x86-64 CPU

Source for downloading rosbag files containing pointclouds

$
0
0
Hey, Can anybody help me with the source from where I could download the rosbag file containing **point cloud data** ? It is very important . Please help!

any provision in python to read .mat data and store it in rosbag file format? Is it possible to convert .mat file into rosbag file? Is it possible to convert .avi file into .mat file in ROS?

$
0
0
Hiii, I am trying to store signal data from avi into a .mat file and again to store the .mat data into bag file using python. Please help me with that.

How to write python code to read pointcloud data from a bag file and display using RVIZ api ?. Can any one help me where to find RVIZ python APIs ? to read bag file and display

$
0
0
I've a bag file. I need to write a Python Application which reads that bag file and display on RVIZ. but i'm not finding any RVIZ APIs tutorial to use. Could you please help me how to proceed in this task ? Thanks
Viewing all 475 articles
Browse latest View live


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