I have ros messages which contains imaged data of type 16UC1. But image_view seems to extract image of type RGB8 only. Is it possible to make it convert 8UC1 and 16UC1 types?
↧
Is it possible to extract gray scale images using image_view?
↧
Extract time from .bag file
Hi, I am trying to process some bag files and, while I am able to get the timestamp for each message, I am not able to get the actual time the message was received. Is it possible to get it? I am using the python api and I could not find any documentations, any help is really appreciated! Thanks for your help!
↧
↧
nodes not working in launch file
Hello guys,
I have the problem that some nodes are not working from launch file. Specifically the tf static_transform_publisher and also the rosbag record. I do not get any error but they are not working in the launch file. When i run them in terminal using rosrun they work perfectly!
any solution or suggestion for this problem?
↧
ROS bag metal detector
i am having trouble extracting information from metal_detector_msg/coil from rosbag file.Can any one provide some information regarding the same.My python scripts works good for imudata msg,camera msg and gps msg.But having 0 value in case of metal_detector_msg/coil.
↧
rosbag play tf issues
I have a very peculiar issue here. When playing the well known bagfile rgbd_dataset_freiburg1_xyz.bag
and have rviz open, the clock gets stuck around 3.780429. If i play back with 10% speed, everything just plays fine.
Also without rviz open, everything just works fine. In general, nodes that listen to the tf topic seem to be problematic.
Any ideas what might cause this issue or how to fix it?
↧
↧
rosbag bag_player issue
Hello everyone,
i am trying to play a bagfile in c++ code using the "bag_player" class, but cannot find a way to
satisfy the second argument of the "register_callback" method.
The code in question currently looks like this:
void LocalizeSimulation::loadBagFile(std::string filename) {
rosbag::BagPlayer bag_player(filename);
bagplayer_ = &bag_player;
bag_.open(filename, rosbag::bagmode::Read);
rosbag::View view(bag_);
bag_player.set_start(view.getBeginTime());
bag_player.set_end(view.getEndTime());
bag_player.start_play();
const std::string scan_topic = "/scan";
bag_player.register_callback(scan_topic, &scanCallback);}
and my scanCallback method like this:
void LocalizeSimulation::scanCallback(sensor_msgs::LaserScan::ConstPtr& scan) {}
But compiling the file yields the error "error: no matching function for call to ‘rosbag::BagPlayer::register_callback(const string&, )’
bag_player.register_callback(scan_topic, &scanCallback);"
while indicating:
note: candidate is: template void rosbag::BagPlayer::register_callback(const string&, typename rosbag::BagCallbackT::Callback)
Attempts to change the method signature to a template have failed and so have numerous attempts at changing the "&scanCallback" argument, e.g. using boost::bind. Unfortunately, there don't appear to be many example uses of the BagPlayer class so I require help from you guys.
Big Thanks in advance
freidankm
↧
How to use service calls to toggle rosbag?
Dear all,
I would like to toggle rosbag with a service call. I want to do this because I put a mini computer on a quadrotor, and I need to rosbag all the messages when I turn on a switch.
Best,
Ziyang
↧
What does "cannot migration from subtype [] to []" mean when generating migration rules?
I'm generating new migration rules for bag files that will be appended to existing migration rules. When generating the new rules I get messages like this:
WARNING: Within rule [some_rule] cannot migration from subtype [some_type] to [some_type]
What does this mean? Is it something that needs to be fixed? It's still generating rules for me, and they seem to be okay.
↧
Playback of rosbag file at the same rate that messages are stored in rospy
Hi,
I am trying to playback data that I have stored using rosbag in rospy. Is it possible to playback the rosbag file in rospy at the same rate that it is recorded? I know that I can do this from the command line, but I would like to be able to do this all in rospy if possible.
Thank you!
↧
↧
when I use the code copy from rosbag tutorials,there some wrong?
when I use the code copy from the tutorial(http://wiki.ros.org/rosbag/Code%20API),but there are some wrong like this:error: expected primary-expression before ‘const’
foreach(rosbag::MessageInstance const m, view);
error: ‘foreach’ was not declared in this scope
foreach(rosbag::MessageInstance const m, view);
I don't know how to correct,I hope someone can help me ,thank you!
↧
Problem for leg_detector in People package when using rosbag play
I have collected /tf and /scan data from a Turtlebot2( i.e. Kobuki robot) by using rosbag record. I also have written a new tracker and want to test it with the recorded data beforehand. The new tracker was based on the leg_detector package. The main modification is the member variable " filter_" in class SavedFeature was changed to be the new tracker.
With the record data, it is possible to compare the tracking results of my tracker with the one in people package.
The launch file is displayed below:
The laser_filter node works fine with the being played bagfile data, the scan_filtered topic ouput normally. However, the leg_detector doesn't work. No messages output in topic /leg_tracker_measuremens.
An warning messages came out:
[ WARN] [1422844504.014663321, 1422676497.431818087]: MessageFilter [target=odom_combined ]: Dropped 100.00% of messages so far. Please turn the [ros.leg_detector.message_notifier] rosconsole logger to DEBUG for more information.
This warning is quite strange. Because I have changed all "odom_combined" to be "odom" and it works in the real robot test as I said in [this previous tips](http://answers.ros.org/question/200158/problem-with-leg_detector-in-people-dropped-10000-message-so-far/)
Looking forwards to any advices. Especially to the author and maintainer @David lu
↧
rosbag doesn't display map in real-time on rviz
I am following the gmapping tutorial, and it says:
If you don't care to wait until the log playback and mapping process has finished before seeing some results, then you can watch the progress in rviz.
rosrun rviz rviz
Add a display with a map, set to the topic /map
I have rosbag of sample data running in a different terminal. I added a display to rviz with topic /map, but it doesn't seem to show anything. There is an exclamation mark beside "Message".
Also, when I type in rqt_graph, no messages are being published to topic /map.
How can I resolve this? I appreciate any help as I am new to this.
Thanks
↧
Issue trying to modify bag contents with python
So I've found out that I need a frame_id in my imu message to be able to visualize it in RViz, so I've been trying to add a frame_id to the bags I have. When I try reading through the messages in the bag I keep getting an error saying "AttributeError: 'str' object has no attribute 'secs'"
Here is the code and the output from the terminal:
![image description](http://oi60.tinypic.com/2wf4oc0.jpg)
I think I've managed to establish that the issue is to do with the itemiterator (or whatever it's called) t, but I haven't had any luck trying to cast it to the secs type.
Any ideas?
↧
↧
Why doesn't the rosbag api support splitted bags files?
Hi,
I am writing a piece of code which uses the rosbag python API to parse a bag file. It crawls a directory and processes all found bags (searches for *.bag). Basically it looks like this
for filename in *.bag
bag = rosbag.Bag(filename)
for topic, msg, ts in bag.read_messages(...):
# do something
# output something
I am having the problem that I encounter splitted bag files.
splitted_2015-02-05-12-24-43_0.bag
splitted_2015-02-05-12-24-45_1.bag
splitted_2015-02-05-12-24-47_2.bag
As the crawling is done automatically (e.g. every night), I do not have the possibility to manually tell the system which bags belong together. I don't like the idea to add this data manually by e.g. adding another description file.
Skipping the once which end with a number different from 0 is easy. But identifying the next part is hard. With *rosbag play* the user defines all parts to join. A manual solution giving each sequence a different prefix is not suitable as I am working on existing files. Currently I am having a heuristic which looks like this:
1) split the filename into: prefix_dateAndTime_counter.bag
2) get the timestamp of the last message in the current bag
3) check if files exist with name
3.1) prefix_dateAndTime(last timestamp)_(counter+1).bag
3.2) add 1 second to "last timestamp" and retry 3.1
4) if 3.1or 3.2 succeed continue with this file otherwise stop parsing
**Question 1**: Has there been a reason to not include meta information about splitted bags into the bagfile? Some meta data telling e.g. the name of the next bagfile.
For the future I would love to have something like:
- an entry at the end of a bag "this bag continues in xyz.bag"
- or an option to tell *rosbag record* keep the timestamp of the first bag fixed and just change the counter, resulting in something like "date_1.bag date_2.bag ..."
**Question 2**: Anything planned like that for the future?
↧
ROS offline bag view with message_filter synchronizer callbacks
I have a stereo camera node that takes in images and camera infos set up with an approximate sync policy:
typedef message_filters::sync_policies::ApproximateTime ApproximatePolicy;
typedef message_filters::Synchronizer ApproximateSync;
approximate_sync.registerCallback(boost::bind(&Node::image_callback, this, _1, _2, _3, _4));
I want to run an offline executable that will open up ros::Views on several rosbags in C++. How can I use the existing callbacks and time synchronizers by iterating through rosbag::MessageInstance?
Thanks!
↧
Cannot include rosbag as catkin dependency
I am having trouble including rosbag as a catkin dependency for my package (to use the C++ API). I have added it as both a build and run dependency in package.xml; i.e.,rosbag rosbag
And it is included in the correct places in CMakeLists.txt; i.e.,
find_package(catkin REQUIRED COMPONENTS
pcl_ros
roscpp
rosbag
sensor_msgs
)
and
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS pcl_ros roscpp sensor_msgs rosbag
)
Yet when I write the simple file
#include
#include
#include
#include
int main()
{
rosbag::Bag bag;
bag.open("test.bag", rosbag::bagmode::Read);
std::vector topics;
topics.push_back(std::string("chatter"));
topics.push_back(std::string("numbers"));
bag.close();
}
I get the following when I invoke catkin_make:
CMakeFiles/write_json.dir/src/write_json.cpp.o: In function `main':
write_json.cpp:(.text.startup+0xe): undefined reference to `rosbag::Bag::Bag()'
write_json.cpp:(.text.startup+0x32): undefined reference to `rosbag::Bag::open(std::string const&, unsigned int)'
write_json.cpp:(.text.startup+0xd1): undefined reference to `rosbag::Bag::close()'
write_json.cpp:(.text.startup+0xe5): undefined reference to `rosbag::Bag::~Bag()'
write_json.cpp:(.text.startup+0xfd): undefined reference to `rosbag::Bag::~Bag()'
collect2: error: ld returned 1 exit status
Does anyone have any idea what I'm doing wrong?
↧
Error playing bagfile ~4GB on 32bit system
Hello, I have no problem with the info comand, but when I am trying to play a bagfile but i am gettint an error.
[FATAL] [1425331406.887155495]: Error opening file: 2015-02-13-10-04-56.bag
Bagfile Info:
duration: 1:40s (100s)
size: 3.8 GB
83651 msg
My friend has no problem in play this bagfile. I have test the example with the turtle and I can reproduce it well. May be the problem because the baffile is very large and my computer is not very new?
I am using Xubuntu 32bit and my friend is using Ubunt 64bit.
Thank you.
↧
↧
Broken laser_assembler bag link. Need tilt_scan bag file
Hi,
The sample bag file in the tutorial page of [laser_assembler](http://wiki.ros.org/laser_assembler/Tutorials/HowToAssembleLaserScans) package is broken or removed.
Can anyone provide a link to the new link for the same file or another bag file which publish on the /tf [tf/tfMessage] and
/tilt_scan [sensor_msgs/LaserScan].
Thanks
Alex
↧
Transform not working with rosbag
I have followed the tutorial to create a tf broadcaster.
Here is the code:
void poseCallback(const sensor_msgs::PointCloud2::ConstPtr& msg){
static tf::TransformBroadcaster br;
tf::Transform transform;
transform.setOrigin( tf::Vector3(0.0, 0.0, 0.0) );
tf::Quaternion q;
q.setRPY(0, 0, 0);
transform.setRotation(q);
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "xtion_link", "camera_link"));
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "subscribe_and_publish");
ros::NodeHandle node;
ros::Subscriber sub = node.subscribe("/camera/depth/points", 10, &poseCallback);
ros::Rate loop_rate(10);
while (ros::ok()) {
ros::spinOnce();
loop_rate.sleep();
}
return 0;
}
The problem is that the transform does not seem to work, properly atleast. When I run the program and the rosbag file and use rosrun tf view_frames I get a nice tree with all the components in it. However the broadcast time between "xtion_link" and "camera_link" is around 4 seconds while time between other broadcasters is around 0.2 seconds.
If i try to visualize the whole thing in rviz and set xtion_link as fixed frame, it shows that all transforms are OK, except the ones below camera_link. If I set camera_link as fixed frame, it shows that xtion_link is OK and others below it but it says that there is no transform from broadcasters above xtion_link.
I don't know if it's caused by the rosbag file or a programmatic error. Rosbag works perfectly in other aspects.
↧
bag migration, fill new field with incrementing counter
Is it possible to fill a new message field in an old bag data with an incrementing counter using a bag migration rules file (http://wiki.ros.org/rosbag/migration) and rosbag fix?
↧