I want to use *rosbag record* in my launch file with the parameters linking to a ros package. Normally, you can get a package path in a launch file by using ${find mypackage}, but this does not work in this case, I presume because the *${find pkg}* command doesn't work in the *args* statement of the launch file (?).
The error in the log shows that the rosbag node is trying to subscribe to topics named *${find* and *mypkg}/subdir*, which clearly is not what is intended.
I definitely don't want to use an absolute path. Is there any way to specify the relative path here?
↧
Record with rosbag from launch file
↧
ROSBAG HECTOR-SLAM
Hi guys, I'm trying to record a hector-slam map with rosbag and then trying to reproduce it.
The thing is I really don't know what should I record and how to reproduce it back in the RVIZ like this:
rosbag play Team_Hector_MappingBox_RoboCup_2011_Rescue_Arena.bag --clock
This is my launch file right now.
where in args I've tried /rviz, /scan, /map
Also tried with the command:
rosbag record /path/to/file /topic
and then
rosbag play file.bag
What should I modify to get what I want? (reproduce the created map)
↧
↧
How to create a map using raw point cloud data?
Hi,
I have a raw point cloud data stored in a rosbag file. How can I generate a map from this rosbag file?
Also, that raw point cloud data has redundant information. How can I extract only the required information and create a map?
Thanks in advance.
↧
Source for downloading rosbag files
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!
↧
laserscan to pointcloud timestamp issue
Dear all,
I want to convert laserscans (sick lms511) to pointcloud2. I have found a topic on how to perform this conversion here :
https://answers.ros.org/question/11232/how-to-turn-laser-scan-to-point-cloud-map/?comment=283322#post-id-283322
My problem is that my laserscans are saved in a rosbag file that was generated from original data (csv) using a third party software. As a consequence, when I use the solution above (transformLaserScanToPointCloud) I get an error due to the difference in timestamps (the laserscans are older than bagtime which is also older than current time).
I tried to fix this issue with the creation of a new rosbag file and setting sim time to false in order to ignore sim time. This did not fix the issue. Then I've repeated this operation with sim time = true, unfortunately I still have the same error.
Please, can you help me with this issue ?
Thanks.
↧
↧
Rosbag Python API: why do messages from a rosbag have mangled __class__?
I find that messages loaded from a rosbag via the Python API, have a weird __class__ attribute:
import rosbag
from sensor_msgs.msg import PointCloud2
# Round-trip a PointCloud2 message to a rosbag and back
bag = rosbag.Bag('test.bag', 'w')
try:
scan = PointCloud2()
print("__class__should be: \n{}".format(scan.__class__))
bag.write('scan', msg)
finally:
bag.close()
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['scan']):
print("But it comes out as: \n{}".format(msg.__class__))
bag.close()
The output:
__class__should be:
But it comes out as:
Is this a bug, or a feature?
ROS Indigo, Ubuntu 14, Python 2.7
↧
Another question about extrapolation in the past
Hello all,
That's a question that has been asked multiple times but none of the solution have worked so far. I'm playing data from a rosbag and when trying to query the tf I have this error:
[ERROR] [1519650555.804462800, 1504014242.149115352]: Lookup would require extrapolation into the past. Requested time 1504014237.046037623 but the earliest data is at time 1504014237.201914971, when looking up transform from frame [base_link] to frame [world]
Here is the code I'm using to query it :
ros::Time stamp = scan->header.stamp;
//Read transformation UGLY TRICK :P
tf::TransformListener listener(ros::Duration(50.0));
std::cout << listener.DEFAULT_CACHE_TIME << " " << listener.getCacheLength() << std::endl;
tf::StampedTransform transform;
try {
listener.waitForTransform(odom_frame_, "/base_link", stamp, ros::Duration(5.0));
listener.lookupTransform(odom_frame_, "/base_link", stamp, transform);
} catch (tf::TransformException ex) {
ROS_ERROR("%s",ex.what());
}
As visible in the code, I tried to change the buffer size to some higher number but it seems this is ignored :/ ?
Also this function is in the callback to a messageFilter in gmappings code:
scan_filter_ = new tf::MessageFilter(*scan_filter_sub_, tf_, odom_frame_, 1);
scan_filter_->registerCallback(boost::bind(&SlamGMapping::laserCallback, this, _1));
I'm running the rosbag with `clock` and I've set `use_sim_time` to true. I've also tried slowing down the rosbag to try have my algorithm catch up but I still have the same problem. So I'm at a loss on what the actual problem is. Using `ros::Time(0) instead of the haeder time stamp works.
What is wrong in the approach I'm having ?
↧
can't install rosbag package
Ubuntu 16.04 LTS Xenial
ROS Kinetic
Linux novice, ROS novice.
Have a catkin workspace with some packages in it (robot_localization etc).
import rosbag
gives error
import error: no module named rosbag
so tried installing:
sudo apt-get update
sudo apt-get install python-rosbag
get error:
p@t:~$ sudo apt-get install python-rosbag
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python-rosbag : Depends: python-roslib but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
What should I do? How do i fix the import error?
**Edit**
I'm sorry. I've been at this for months now. I didn't study for this. Frustration is making me go crazy.
$ which python returns "/usr/bin/python" now. I assume this is what it's supposed to be?
$ grep -i anaconda /home/pieter/.bashrc returns "grep: /home/pieter.bashrc: No such file or directory" if that's still relevant
$ ~/folderimworkingin python file.py now returns with error ending in
File "/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 83, in get_msg_file
% (base_type, package, search_path), base_type, package, search_path)
genmsg.msg_loader.MsgNotFound: Cannot locate message [Header]: unknown package [std_msgs] on search path [{}]
So am I missing a message package now or?
**Edit**
pieter@turing:~/benchmarking$ rospack find std_msgs
/opt/ros/kinetic/share/std_msgs
Seems reasonable.
>>> import std_msgs
>>>
does not complain.
Python --version
returns 2.7.12 now (instead of 2.7.14).
File.py:
#import numpy as np
#import scipy.io
from bag import get_topic_data
testfile = "/home/pieter/benchmarking/bagfiles/2018-03-03-11-13-48.bag"
testdata = get_topic_data(testfile,"/android/imu")
#size = len(testdata)
#print(size)
with bag.py:
import rosbag
def get_topic_data(bagFile, topic):
all_msg = []
# Initialize rosbag object
bag = rosbag.Bag(bagFile)
for topic, msg, t in bag.read_messages(topics=[topic]):
all_msg = np.append(all_msg, msg)
return all_msg
bag file I think is accessible?:
https://github.com/PieterVanB/bagfile
↧
How to associate Rosbag time with data
Hello everyone!
I have saved some flight data using rosbag record, but the header of my topic /odom doesn't contain the time. When I extract the data using rostopic echo -b foo.bag -p /odom > odom.csv, the column %time is always 0.
I was wondering how can the rosbag and rxbag can synchronize the data... I would like to know the mechanic and how I can get the rosbag time to associate it with the data.
↧
↧
How to change the frame_id from recorded bag files [bag_tools don't work]
Hi to all,
I need to change the frame_id of my `imu/data` topic from `/base_imu` to `base_imu`.
I'm using Indigo.
Unfortunately, I recorded several bag files without removing the slash character now I can't run them since I always get this error message:
Warning: Invalid argument "/base_imu" passed to canTransform argument source_frame in tf2 frame_ids cannot start with a '/' like:
at line 130 in /tmp/binarydeb/ros-indigo-tf2-0.5.15/src/buffer_core.cpp
I know that I can use [bag_tools](http://wiki.ros.org/bag_tools?distro=indigo), but they do not work: if I try to install them from apt-get the package "`change_frame_id`" is not found, if I try to install them from source, catkin_make fails and do not build the package.
Is there any other way to change the frame_id?
Can you help me, please?
↧
how can I record the same number of massages from different topics?
I want to build a database that takes each image with its joy and IMU (angles) data, so I need to receive the same number of messages for each topic to have a synchronized data.
I run the below command in order to record RGB images, depth images, joystick commands, and IMU data.
$> rosbag record -O subset /camera/depth/image_raw /camera/rgb/image_raw /joy /mobile_base/sensors/imu_data_raw
then
$> rosbag info subset.bag
which show me the information about my recorded bag file
> path: subset.bag> version: 2.0> duration: 21.9s> start: Mar 11 2018 16:31:17.29 (1520771477.29)> end: Mar 11 2018 16:31:39.20 (1520771499.20)> size: 857.5 MB> messages: 3113> compression: none [605/605 chunks]> types: sensor_msgs/Image [060021388200f6f0f447d0fcd9c64743]
sensor_msgs/Imu [6a62c6daae103f4ff57a132d6f95cec2]
sensor_msgs/Joy [5a9ea5f83505693b71e785041e67a8bb]> topics: /camera/depth/image_raw 652 msgs : sensor_msgs/Image
/camera/rgb/image_raw 540 msgs : sensor_msgs/Image
/joy 991 msgs : sensor_msgs/Joy
/mobile_base/sensors/imu_data_raw 930 msgs : sensor_msgs/Imu
as you see there are a diffrente number of messegas for each topic. So, how can I receive the same number of it?
and one more thing
any help please?
Thanks in advance
↧
Method for filtering out gps topic in a bag file
Hi everyone,
I have recorded a bag file which contains gps topic for using with robot_localization pkg. I want to modify my gps topic to mimic a scenario where gps signal is not available, e.g transition from indoor to outdoor and vice versa. Using [topic tools](http://wiki.ros.org/topic_tools) I was able to drop/filter out my gps messages. The result is in the following picture:
![drop gps messages](/upfiles/15209469275838605.png)
topic_tools drops X out of Y messages *regularly* as it is supposed to (blue dots). My question is: is there any method that can drop messages for ***a specific time length***? For clarification, I would like something like this:
![image description](/upfiles/152094772132852.png)
where the yellow lines are my gps messages and the gaps between them are dropped gps messages.
I appreciate your help!
↧
exclude some topics from rosbag play
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?
↧
↧
rosbag doesn't playback at same speed
Hi,
I have recorded a rosbag w topics at ~7 Hz. When I use `rosbag play` on those topics, they playback at 2Hz. The `rosbag info` too shows a total time of say 10 secs for instance but on playing it, it goes on for much more than 10 seconds.
Any tools you would recommend for me to debug without having to go through the code?
Thank you
edit 1: turns out it's `image_view` that I'm running which slows it down. Is this a known problem that image_view doesn't show images at ~7Hz at 3MP?
↧
How to display bag file in rviz
Hi all, I am new on ROS and Linux. I am trying to display point cloud using rviz with VLP-16. Before starting to see real time data, I wanted to see how pcap file can be converted into human-readable, and visible data. So I used pcap file (downloaded from www.velodynelidar.com) to convert to bag file as follows:
$ rosrun velodyne_driver velodyne_node _mol:=VLP16 _pcap:=/home/soowon/Documents/County_Fair.pcap _read_once:=true
On new terminal, to record pcap data into bag file:
$ rosrun rosbag record -O Countyfair.bag /velodyne_packets
ON new terminal, I used rosbag to play bag file that I just made:
$ rosbag play Countyfair.bag
Another new terminal, to open rviz:
$ rosrun rviz rviz
Problem starts from here.
1. I cannot see anything on the screen, even though I added PointCloud, PointCloud2. In rviz, it says "No tf data. Actual error: Fixed Frame [map] does not exist."
2. Not only that I want to see point cloud in rviz, my ultimate goal is acquiring xyz coordinates for each frame. Can you guys tell me where can I find this data?
Any advice? I would appreciate :)
↧
how record rosbag with python
Hello
I use the command line (Terminal) to record images (RGB, RGBD), joy, and IMU data>> rosbag record -O subset /camera/depth/image_raw /camera/rgb/image_raw /joy /mobile_base/sensors/imu_data_raw
How can I convert this command to python code script?
any help is appreciated
↧
How to visualize/read string messages from Rosbag
I have received a bag file from a colleague and i need to analyze it. The file looks like this. ![image description](/upfiles/15223247925442699.png)
How can i visualize this in rviz ? What type shoul i select here instead of point cloud ? ![image description](/upfiles/15223248851438932.png)
↧
↧
rosbag with --rate-control-topic and -rate option results segmentation fault
Hi,
I am getting segmentation fault while using the rosbag with rate control topic and rate option. Did anybody face the same issue before?
rosrun rosbag play --rate-control-topic /topic11 --rate-control-max-delay 1.0 bagfile.bag --clock -r 3
Thank you very much!
↧
Is there a way to extract rosbag files without using ros packages
While ROS is useful, t's very annoying to install. I'm trying to make an extraction pipeline that is user friendly and can be used across multiple platforms and ros packages just get in the way. All I want to do is extract videos. Has anyone created a script (preferably in python or matlab), to easily extract rosbag files?
↧
Read a msg inside a bagfile
In the rosbag/Code API, we could see the msg by:
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
print msg
bag.close()
When I try this, I see several msg entries. How could I select only one of entries to display?
![image description](/upfiles/15227291792382243.png)
Like, for example. How could I get the data vector only?
↧