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

Issues with LZ4

$
0
0
As some of you know, I've been working on the [Gentoo install for ROS](http://wiki.ros.org/jade/Installation/Gentoo). I am very close! I have GMapping and RVIZ working, but there are a few issues left to resolve. First on the list is the LZ4 module. For example, I obtain the following when I run `rostopic list`. allenh1@tuxbox ~ $ rostopic list Traceback (most recent call last): File "/opt/ros/jade/bin/rostopic", line 35, in rostopic.rostopicmain() File "/opt/ros/jade/lib64/python2.7/site-packages/rostopic/__init__.py", line 1753, in rostopicmain import rosbag File "/opt/ros/jade/lib64/python2.7/site-packages/rosbag/__init__.py", line 33, in from .bag import Bag, Compression, ROSBagException, ROSBagFormatException, ROSBagUnindexedException File "/opt/ros/jade/lib64/python2.7/site-packages/rosbag/bag.py", line 65, in import roslz4 File "/opt/ros/jade/lib64/python2.7/site-packages/roslz4/__init__.py", line 33, in from ._roslz4 import * ImportError: No module named _roslz4 Or, if I run rosbag. allenh1@tuxbox ~ $ rosbag Traceback (most recent call last): File "/opt/ros/jade/bin/rosbag", line 34, in import rosbag File "/opt/ros/jade/lib64/python2.7/site-packages/rosbag/__init__.py", line 33, in from .bag import Bag, Compression, ROSBagException, ROSBagFormatException, ROSBagUnindexedException File "/opt/ros/jade/lib64/python2.7/site-packages/rosbag/bag.py", line 65, in import roslz4 File "/opt/ros/jade/lib64/python2.7/site-packages/roslz4/__init__.py", line 33, in from ._roslz4 import * ImportError: No module named _roslz4 Naturally, I am hesitant to call such an issue a bug, as I am running on an unsupported OS. So I did some investigating. allenh1@tuxbox /opt/ros/jade/lib64/python2.7/site-packages $ ls | grep lz4 roslz4 roslz4-1.11.13-py2.7.egg-info allenh1@tuxbox /opt/ros/jade/lib $ ls |grep lz4 libroslz4.so Not sure why there is trouble here... Thanks! ---------- It appears that you have found the problem... So we're at least half way there. :) allenh1@tuxbox /opt/ros/jade/lib64/python2.7 $ ls site-packages allenh1@tuxbox /opt/ros/jade/lib/python2.7 $ ls site-packages So the directory you mentioned, `dist-packages` is not being copied correctly.

Rosbag Record Speed

$
0
0
Hey, I am trying to record a bag file on an odroid (ARMv7) Board that acquires 95 fps images from a camera but running rosbag record freezes the publishing topic. Also, whatever is recorded barely has 95fps data. So is it because the processor can't write at that speed? But if it is so why does it freeze after some time. I also tried Tegra TK1 board which does not freeze but still the fps from rosbag on playing is around 10. Is it the same issue? Thanks

How to save rViz joint position in bag file

$
0
0
Hi guys, I'm trying to calculate by hand the kinematics of a simple 3-DOF manipulator and I want to automate my kinematics testing by using rViz with a transform publisher. Here's a screenshot of my rViz workspace [C:\fakepath\Screenshot from 2015-08-05 13:19:58.png](/upfiles/14387952945062489.png) I just want to log the X,Y,Z position of the joint_4 (see in the left panel in the screenshot) Is it possible ? Thanks !

How to use rosbag play to paly multiple rosbags which are in a folder with a single command ?

$
0
0
I have several rosbags in a folder, and I want to use rosbag play to play them one by one automatically. So what should I do with the name of folder or its path so I can make the use of '' rosbag play'' ?

Catkin_make fails due to Bzip2 libraries on Raspberry Pi

$
0
0
Hi, I'm using Ros Indigo installed on a Raspberry Pi model B. When I run catkin_make I get an error during the compilation of RosBag-storage package. The BZIP2_LIBRARIES BZIP2_INCLUDE_DIR are missing. -- +++ processing catkin package: 'rosbag_storage' -- ==> add_subdirectory(ros_comm/rosbag_storage) -- Boost version: 1.49.0 -- Found the following Boost libraries: -- date_time -- filesystem -- program_options -- regex CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE): Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-2.8/Modules/FindBZip2.cmake:47 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) ros_comm/rosbag_storage/CMakeLists.txt:8 (find_package) -- Configuring incomplete, errors occurred! Invoking "cmake" failed How can I add these libraries?

Does rosbag write cause a memory leak?

$
0
0
I have the following code running on x86-64 Linux with ROS indigo: #include #include #include #include #include #define TWO_MiB (2*1024*1024) int main(int argc, char **argv) { std::string name("testwrite"); ros::init(argc, argv, name, 0); struct sysinfo info; ros::Time time = ros::Time::now(); ros::Rate loop(1); // 1 Hz while(ros::ok()) { std_msgs::String str; rosbag::Bag *bag = new rosbag::Bag(); // Using bagmode::Write mode does not cause a memory leak. // but it also does not write continuously to a file, as you would expect. bag->open("test.bag", rosbag::bagmode::Append); sysinfo(&info); ROS_INFO("TR0. Mem: Free:%.1f MB\n", info.freeram / (float) 1e6); void *mem = malloc(TWO_MiB); if (!mem) goto loop_free; memset(mem, 'a', TWO_MiB); str.data = (char *) mem; // Remove the following line and no memory is leaked. bag->write("strings", time, str); sysinfo(&info); ROS_INFO("TR1. Mem: Free:%.1f MB\n", info.freeram / (float) 1e6); // Ensure the memory used by the bag is **really** free bag->close(); delete bag; loop_free: free(mem); sysinfo(&info); ROS_INFO("TR2. Mem: Free:%.1f MB\n", info.freeram / (float) 1e6); loop.sleep(); } return 0; } And the output is as follows: [ INFO] [1440540265.784606302]: TR0. Mem: Free:3250.6 MB [ INFO] [1440540265.811953308]: TR1. Mem: Free:3229.3 MB [ INFO] [1440540265.814442553]: TR2. Mem: Free:3241.2 MB [ INFO] [1440540266.784350396]: TR0. Mem: Free:3241.3 MB [ INFO] [1440540266.808669181]: TR1. Mem: Free:3225.1 MB [ INFO] [1440540266.811110143]: TR2. Mem: Free:3236.9 MB [ INFO] [1440540267.784398301]: TR0. Mem: Free:3237.0 MB [ INFO] [1440540267.808999283]: TR1. Mem: Free:3220.7 MB [ INFO] [1440540267.811474048]: TR2. Mem: Free:3232.6 MB [ INFO] [1440540268.784463342]: TR0. Mem: Free:3232.7 MB [ INFO] [1440540268.808201640]: TR1. Mem: Free:3216.5 MB [ INFO] [1440540268.810761252]: TR2. Mem: Free:3228.3 MB [ INFO] [1440540269.784520258]: TR0. Mem: Free:3228.4 MB [ INFO] [1440540269.809175512]: TR1. Mem: Free:3212.2 MB [ INFO] [1440540269.811680539]: TR2. Mem: Free:3224.0 MB [ INFO] [1440540270.789515610]: TR0. Mem: Free:3224.1 MB [ INFO] [1440540270.814318890]: TR1. Mem: Free:3207.8 MB [ INFO] [1440540270.816899544]: TR2. Mem: Free:3219.8 MB [ INFO] [1440540271.784680288]: TR0. Mem: Free:3219.7 MB [ INFO] [1440540271.809407003]: TR1. Mem: Free:3203.2 MB [ INFO] [1440540271.811989272]: TR2. Mem: Free:3215.2 MB If I comment out bag.write the memory on my system stays stable. Am I using rosbag incorrectly or is the call to rosbag::Write leaking memory?

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? Please help!

Bug in rosbag with compressed files?

$
0
0
Hello all, I have recorded a fairly long rosbag file (~8.5Mb). However, when I try to play it I get: [FATAL] [1441050519.918179421]: size of the compressed data exceeds *destLen Here is rosbag info: path: M200-0211.bag version: 2.0 duration: 10hr 47:10s (38830s) start: Aug 28 2015 14:28:56.45 (1440786536.45) end: Aug 29 2015 01:16:06.82 (1440825366.82) size: 8.1 MB messages: 175484 compression: bz2 [26/26 chunks; 30.41%] uncompressed: 19.3 MB @ 0.5 KB/s compressed: 5.9 MB @ 0.2 KB/s (30.41%) types: batmon/bat_data [bdfbbcf4c50a2392913c2601912adfc3] rosgraph_msgs/Log [acffd30cd6b6de30f120938c17c593fb] std_msgs/UInt8 [7c8164229e7d2c17eb95e9231617fdee] topics: /B1 5 msgs : std_msgs/UInt8 /B2 6569 msgs : std_msgs/UInt8 /BATMON 155755 msgs : batmon/bat_data /rosout 6583 msgs : rosgraph_msgs/Log (6 connections) /rosout_agg 6572 msgs : rosgraph_msgs/Log The file itself is **[here](https://mrrobot.ca/owncloud/index.php/s/R9IgcTou7UhgHkM)**, though it needs custom message type from: https://github.com/ibaranov-cp/batmon

Emulate missing messages from rosbag; publish only every 2nd/4th/8th message

$
0
0
I would like to check would stable some of my processing nodes work if there is data lost somehow. I would like to do so by feeding them only with every 2nd/4th/8th message of each topic of a rosbag. Is there anything ready to use for this? If not there might be the following approaches for this: 1. Use rosbag API to convert the bag and create a copied bag file that contains only every 2nd/4th/8th message. 2. Set up a republisher node between the rosbag and the processing chain that only passes every 2nd/4th/8th message. 3. Anything else you suggest;) Which approach do you think is perferable?

Error in rosbag play despite setting use_sim_time param

$
0
0
**(ROS Hydro on Ubuntu 12.04)** I am following the tutorial on [Recording and Playing Back Kinect Data](http://wiki.ros.org/openni_launch/Tutorials/BagRecordingPlayback). First, I recorded a rosbag file using rosbag record camera/depth_registered/image_raw camera/depth_registered/camera_info camera/rgb/image_raw camera/rgb/camera_info --limit=60 -O kinectbag As suggested in the tutorial, before playing back, I need to set the `use_sim_time` parameter. To do this, first I launch openni_launch without loading drivers roslaunch openni_launch openni.launch load_driver:=false Then, I set the parameter with rosparam set /use_sim_time true and confirmed that the parameter has indeed been set with the `rosparam get /use_sim_time` command (which returns true). I am trying to visualize the playback in rviz (added PointCloud2 to rviz with appropriate Fixed Frame and topic settings) using following playback command rosbag play --clock --pause kinectbag.bag At this point, the Status of PointCloud2 shows an error saying > Transform [sender=/camera/camera_nodelet_manager] Message removed because it is too old (frame=[/camera_rgb_optical_frame], stamp=[1442173625.519280128]) and a warning is printed on the terminal (from which I invoked rviz) > [ WARN] [1442177967.606387020, 1442173623.553857221]: Detected jump back in time. Clearing TF buffer. I can see that prior to loading the `rosbag play` command, the ROS time in rviz is set to 0, and it changes to the timestamp of the first message in my rosbag recording after I issue the play command (hence, it is indeed using simulated time, and not wall time). Can anyone point out what might be causing this error? P.S: I know that hundreds of similar queries have been answered before here, but they all are resolved by setting the `use_sim_time` parameter. In my case, I am facing the issue in spite of doing that.

"rosbag record -a" in C++?

$
0
0
I want to implement a node which is able to start recording every topic. It should record everything like the command line `rosbag record -a`. is there a possibility to use that command or something similar in a node which is implemented in c++?

Filter and play a bag file

$
0
0
I'd like to play a bag file as part of a roslaunch and apply a filter to it at the same time. I couldn't find anything better than doing the filter step beforehand, which is awful if one needs a number of stripped versions of the same bag file. Am I missing something here? Thank you all

Kill roscore and all nodes when rosbag play finishes?

$
0
0
Hello, I'm writing some automated test scripts. I'd like to run a launch script with a bag file, which works fine. But when the rosbag play completes I would like roslaunch to exit so my script can load up a new bag file and rerun roslaunch with the test.launch file. Is there an elegant way to cause all ros nodes and roscore to exit when a bag file is finished? I was thinking of making another script to monitor when rosbag finished and then execute a rosnode kill, but I thought there might be a better way. Thanks, Jason

collecting and organizing rosbag files

$
0
0
Recording rosbag files is great. After multiple recording sessions, I'm left with all these bag files that are really only telling me date/time by direct observation. I can do rosbag info to get more details. I was wondering if anyone had a best practice for collecting, storing, and organizing rosbag files. I'm thinking of a database containing rosbag files with additional metadata including some text field for a description of what was recorded. Maybe this problem has already been solved. Thanks in advance.

Rosbag on srvs?

$
0
0
Hi, Is it possible to record the requests and responses over a srv with rosbag? When I use rosbag record on the srv name, the bag files are empty. I can't find any documentation about using rosbag with srvs so I thought I should ask here to confirm.

Use generic home directory reference from launch file

$
0
0
I am running a .bag file from a launch file but I want to make the filepath generic so other team members can run this launch file. So I have: But not everyone on my team is named jimbob so I want to replace "/home/jimbob/" with maybe ${HOME} or something generic.

rosbag to variable

$
0
0
HI, I have saved a rosbag with the goal topic of an action: ... messages: 1 compression: none [1/1 chunks] types: control_msgs/FollowJointTrajectoryActionGoal [cff5c1d533bf2f82dd0138d57f4304bb] topics: /robot_joint_trajectory_action_controller/follow_joint_trajectory/goal 1 msg : control_msgs/FollowJointTrajectoryActionGoal What I was trying to do was to copy this 1 message to a variable so I can call the service with this saved goal within my cpp node: rosbag::Bag bag; bag.open("test.bag", rosbag::bagmode::Read); std::vector topics; topics.push_back(std::string("/robot_joint_trajectory_action_controller/follow_joint_trajectory/goal")); rosbag::View view(bag, rosbag::TopicQuery(topics)); foreach(rosbag::MessageInstance const m, view) { control_msgs::FollowJointTrajectoryActionGoal::ConstPtr s = m.instantiate(); if (s != NULL){ goal=s; } } bag.close(); //ac.sendGoal(goal); //wait for the action to return bool finished_before_timeout = ac.waitForResult(ros::Duration(30.0)); if (finished_before_timeout) { actionlib::SimpleClientGoalState state = ac.getState(); ROS_INFO("Action finished: %s",state.toString().c_str()); } else{ ROS_INFO("Action did not finish before the time out."); } Of course i cannot do s=goal. How to do this? Thanks!

Read Rosbag into Variable

$
0
0
Hello everyone, I am trying to read from a rosbag within my c++ node, and store the value of a message in a variable: This is my rosbag info: path: moveToPreGraspPosition.bag version: 2.0 duration: 0.0s start: Nov 03 2015 09:50:28.73 (1446544228.73) end: Nov 03 2015 09:50:28.73 (1446544228.73) size: 21.0 KB messages: 1 compression: none [1/1 chunks] types: control_msgs/FollowJointTrajectoryActionGoal [cff5c1d533bf2f82dd0138d57f4304bb] topics: /mbot05/cyton_joint_trajectory_action_controller/follow_joint_trajectory/goal 1 msg : control_msgs/FollowJointTrajectoryActionGoal So, I have one message of type `control_msgs/FollowJointTrajectoryActionGoal` and I want to create a variable of this type in my code and store this info in that variable. I followed some tutorials online and this is what I came up with: actionlib::SimpleActionClient ac("cyton_joint_trajectory_action_controller/follow_joint_trajectory", true); ac.waitForServer(); //will wait for infinite time rosbag::Bag bag; bag.open("/home/catkin_ws/src/pick_place_demo/moveToPreGraspPosition.bag", rosbag::bagmode::Read); std::vector topics; topics.push_back(std::string("/mbot05/cyton_joint_trajectory_action_controller/follow_joint_trajectory/goal")); rosbag::View view(bag, rosbag::TopicQuery(topics)); BagSubscriber teste; BOOST_FOREACH(rosbag::MessageInstance const m, view) { control_msgs::FollowJointTrajectoryActionGoal::ConstPtr s = m.instantiate(); if (s != NULL) teste.newMessage(s); } bag.close(); ac.sendGoal(teste.goal); //control_msgs::FollowJointTrajectoryActionGoal sd2; //ac.sendGoal(sd2.goal); bool finished_before_timeout = ac.waitForResult(ros::Duration(30.0)); if (finished_before_timeout){ actionlib::SimpleClientGoalState state = ac.getState(); ROS_INFO("Action finished: %s",state.toString().c_str()); }else{ ROS_INFO("Action did not finish before the time out."); } Where BagSubscriber is defined like this: template class BagSubscriber : public message_filters::SimpleFilter { public: void newMessage(const boost::shared_ptr&msg) { signalMessage(msg); } }; When I run this, however, I cannot access the field "goal" inside my variable because I have the wrong type, giving me a compiling error: /home/catkin_ws/src/pick_place_demo/src/PickObject.cpp:108:21: error: ‘class BagSubscriber>>’ has no member named ‘goal’ If run the commented lines instead, it compiles smoothly. Do you know how I can copy the contents of my bag topic to my variable so it's clean? If I try other approaches to make `s` igual to `sd2` I usually get this: no known conversion for argument 1 from ‘control_msgs::FollowJointTrajectoryActionGoal_>::ConstPtr {aka boost::shared_ptr>>}’ to ‘const control_msgs::FollowJointTrajectoryActionGoal_>&’

How to store explored nodes in ROS?

$
0
0
Hi, I am using nav2d to explore a map. Is there any way I can store the order of explored nodes in a data structure? I was thinking we can whether I can use rosbag for this somehow. Please let me know if anyone knows about this Thanks

Playing big files with rosbag

$
0
0
Hi everybody, I am running Ubuntu 12.10, with ROS Groovy. My computer has a i7 processor with 6GB of RAM. I am recording in rosbag data from two kinects (and two skeletons). Of course, I din't recorded the "PointClouds", but only the raw images. However, my files go up to 50 GB for a 12minutes videos... My problem is that for such big files, "rosbag play" takes forever to start to play the data. I was wondering on the way it works. Indeed, I thought it played a stream of the data, thus, whatever the size of the file, it should not take that much longer to start playing. However, as I saw in my experiment, it is not the case. Thus I maybe thought that rosbag play is putting a lot in memory, or doing some "precomputation" ? If someone who knows how rosbag works could enlighten me of his knowledge, it would be great. I know this question is very technical, but I would really like to find a way to open my files after recording them, without having to buy a new "very powerful and expensive" computer... My first thought would be to record each topic in one bag, and then replay them all in the same time... But seems a bit stupid to do that, as I think rosplay would need to "realign" in time all the messages. Thanks in advance, Steph
Viewing all 475 articles
Browse latest View live


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