Hi,
I am using different AR tags and need to know how I can save their poses into a text file so I can use their poses in a MATLAB code. When I use "echo", it gives me a long list with different markers_id and the poses are not fixed. Any suggestion?
Thanks
↧
How to get markers pose in a file?
↧
waiting for the map problem
I follow the tutorial " slam_gmapping Tutorials MappingFromLoggedData " ,
and when I enter this command " rosrun map_server map saver " , I have this message " waiting for the map "
and after there are nothing.
What is the problem, I had forgot a step, or any configuration?
↧
↧
Storing the data inside an array as rosbag
Hi,
Is there a way I can store data in my array (inside a c++ program) as rosbag? Just like I can store it as txt or csv file. I know we can store data being published over a ros topic as rosbag but I am wondering if I can do that without publishing the data on rostopic.
regards
↧
dependency issue Hydro Raspberry Pi
I am following the Wiki instructions on a NOOB install of hydro on Raspberry Pi
Exception caught during install: Error processing 'ros_comm/rosbag' : [ros_comm/rosbag] Checkout of https://github.com/ros-gbp/ros_comm-release.git version release/hydro/rosbag/1.10.2-0 into /home/pi/ros_catkin_ws/src/ros_comm/rosbag failed.
ERROR in config: Error processing 'ros_comm/rosbag' : [ros_comm/rosbag] Checkout of https://github.com/ros-gbp/ros_comm-release.git version release/hydro/rosbag/1.10.2-0 into /home/pi/ros_catkin_ws/src/ros_comm/rosbag failed.
**then I tried:**
pi@rosberry ~/ros_catkin_ws $ cd src
pi@rosberry ~/ros_catkin_ws/src $ git clone https://github.com/ros-gbp/ros_comm-release.git
Cloning into 'ros_comm-release'...
remote: Reusing existing pack: 95971, done.
remote: Total 95971 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (95971/95971), 11.63 MiB | 612 KiB/s, done.
Resolving deltas: 100% (32900/32900), done.
pi@rosberry ~/ros_catkin_ws/src $ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
-----****----
Add distro "indigo"
updated cache in /home/pi/.ros/rosdep/sources.cache
pi@rosberry ~/ros_catkin_ws/src $ cd ..
pi@rosberry ~/ros_catkin_ws $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rostopic: No definition of [rosbag] for OS [debian]
rosmsg: No definition of [rosbag] for OS [debian]
I checked, there is an /etc/os-release file that says debian -- wheezy
The lsb_release command also reports debian -- wheezy
So I am stuck on getting hydro up on Pi. I have got hydro up on Beaglebone Black, Radxa Rock and Pandaboard using a ubuntu install for hydro, with only minor dependency issues.
Thanks
↧
rosbag recording resolution / create cyclic snapshots
Hi guys,
as we have a huge amount of data to record, we would like to be able to reduce the resolution of the data being recorded. From looking at rosbag I don't think its possible yet, right?
As nearly all messages are sent in a high frequency, we want to record them for logging and debugging purposes. But for debugging a smaller data set would be enough, like making snapshots of the last message on a topic every 100ms.
Is it possible to add this functionality to rosbag directly or is it against the idea of this tool?
↧
↧
Tools for rosbag analysis - Others that are used?
What tools have people developed and use for rosbag analysis?
I know of rqt_bag (which is an absolutely awesome tool), which allows you to browse the topics in a concise timeline, and using that in conjunction with rqt_plot to plot data. However, it's still a little cumbersome to extract data for more detailed analysis.
I've created a small package using numpy that will parse a rosbag given a set of topic paths (consisting of fields and optionally indices, much like extracting data for plotting) and return simple multi-variable data sets for ease of plotting and analysis, which includes interpolating data sets so that they are on a time scale (with the same spacing). This allows basic errors to be computed. If you also published the same data, you can use this to potentially see delays between the different publishers.
You can always run the conversion, then save the final datasets to Matlab to plot and examine as well. Really easy to do in Spyder.
Will upload the package in a bit.
EDIT:
Googled and saw Pandas from this presentation: https://speakerdeck.com/nzjrs/managing-complex-experiments-automation-and-analysis-using-robot-operating-system
Looks interesting, will start looking at this.
↧
Creating a bag file out of a image sequence
Let's say I have a series of images and want to create a bag file out of them to use as input for the camera calibration.
Is it even necessary to create the bag for the calibration or is there another way to use the images?
If not, can a bag file be created from an image sequence? I guess using some python-fu it should be possible. Would that be a good idea?
UPDATE: Using the bag file for calibration seems not feasible as the standard calibration app insists on talking back to the camera. So to use that one will need to hack the script. The other possibility that might be working (testing atm) is a not documented script "tarfile_calibration.py" which can read a tar file containing the image sequence. Simply create a tar file with numbered images in format "left%d.png" and "right%d.png" and you're good to go:
rosrun camera_calibration tarfile_calibration.py MyImages.tar --square 0.108 --size 8x6
↧
Can't read bagfile containing custom messages
I have a bag file with video and imu data defined with custom messages that I want to read (especially topics /capture and /imu_raw). I know from documentation what the structure of the custom messages is. How can I read the data?
Doing **rosbag info** on the file shows: types: libks/ImageSet [b3ef08c9cff052c83f5039d098add069] pximu/AttitudeData [bc609da5ddac9016c096c67da33d8b9c] pximu/RawIMUData [0380911195329d307d8f033bc714dbbf] [...] topics: /attitude 2174 msgs : pximu/AttitudeData /capture 3282 msgs : libks/ImageSet /imu_raw 10873 msgs : pximu/RawIMUData [...] I cannot play the file with 'rosbag play', probably because rosbag doesn't know the message definitions. Therefore, I thought I needed to use migration(see http_wiki_ros_org/rosbag_migration) and provide custom message definitions (see http_wiki_ros_org/msg) and use them in a rule file. I made a new package 'bag_analyser", and added the custom messages to the 'msg' folder and compiled. E.g. for ImageSet I made a file ImageSet.msg:
Header header sensor_msgs/Image[] images This seems to work, e.g. for **' rosmsg show bag_analyser/ImageSet'** I get:
std_msgs/Header header uint32 seq time stamp string frame_id sensor_msgs/Image[] images std_msgs/Header header uint32 seq time stamp string frame_id uint32 height uint32 width string encoding uint8 is_bigendian uint32 step uint8[] data
I also made messages for RawIMUData and AttitudeData. Then I generated a rules file (rules.bmr, see full output at end), adjusted the rules that needed to be adjusted and executed: rosbag fix original_bag.bag converted_bag.bag rules.bmr which told me "bag migrated successfully". Doing **rosbag info** on the converted file gives me:
types: bag_analyser/AttitudeData [bc609da5ddac9016c096c67da33d8b9c] bag_analyser/ImageSet [b3ef08c9cff052c83f5039d098add069] bag_analyser/RawIMUData [0380911195329d307d8f033bc714dbbf] [...] topics: /attitude 2174 msgs : bag_analyser/AttitudeData /capture 3282 msgs : bag_analyser/ImageSet /imu_raw 10873 msgs : bag_analyser/RawIMUData My problem is that I still cannot read the file. I tried using **'rosbag play'** but it simply gives me: [ INFO] [1402332944.127314834]: Opening converted_bag.bag [FATAL] [1402332944.127848761]: Error opening file: converted_bag.bag I also tried reading in the file using the rosbag API, which also fails opening the file (code in image_converter.cpp below). I changed the bagfile's permissions and set it to allow read/write/execute just to make sure it wasn't that. **What am I doing wrong? How can I read the data from the file?** I am fairly new to ROS, so any help or tips are greatly appreciated!
**File listings:**
---------------------------------------- folder bag/analyser/msg
ImageSet.msg Header header sensor_msgs/Image[] images RawIMUData.msg Header header # Measured accelerations (in x, y, z) Vector3f acc # Measured angular speeds (around x, y, z) Vector3f gyro # Measured magnetic field (around x , y, z) Vector3f mag Vector3f.msg float32 x float32 y float32 z AttitudeData.msg Header header # roll angle [rad] float32 roll # pitch angle [rad] float32 pitch # yaw angle [rad] float32 yaw # roll angular speed [rad/s] float32 rollspeed # pitch angular speed [rad/s] float32 pitchspeed # yaw angular speed [rad/s] float32 yawspeed bag_analyser/image_converter.cpp ( includes message definition for ImageSet.h and tries to use rosbag API to read file):
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
static const std::string OPENCV_WINDOW = "Image window";
void loadBag() {
rosbag::Bag bag("~/robotics/rosbook/src/bag_analyser/bag/converted_bag.bag"); // fails here
std::string l_cam_image = "/capture";
std::vector topics;
topics.push_back(l_cam_image);
rosbag::View view(bag, rosbag::TopicQuery(topics));
BOOST_FOREACH(rosbag::MessageInstance const m, view)
{
if (m.getTopic() == l_cam_image || ("/" + m.getTopic() == l_cam_image))
{
boost::shared_ptr image_array =
m.instantiate();
bag_analyser::ImageSet* theSetPtr = image_array.get();
bag_analyser::ImageSet theSet = *theSetPtr;
cv_bridge::CvImagePtr cv_ptr;
try
{
cv_ptr = cv_bridge::toCvCopy(theSetPtr->images[0], sensor_msgs::image_encodings::BGR8);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
// Update GUI Window
cv::imshow(OPENCV_WINDOW, cv_ptr->image);
cv::waitKey(3);
}
}
bag.close();
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "image_converter");
loadBag();
ros::spin();
return 0;
}
bag_analyser/CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3) project(bag_analyser) ## Find catkin macros and libraries find_package(catkin REQUIRED COMPONENTS cv_bridge image_transport message_generation roscpp rospy std_msgs rosbag ) ## System dependencies are found with CMake's conventions find_package(Boost REQUIRED COMPONENTS system) find_package( OpenCV REQUIRED ) ## Generate messages in the 'msg' folder add_message_files( FILES ImageSet.msg RawIMUData.msg Vector3f.msg AttitudeData.msg ) ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES std_msgs sensor_msgs ) ## CATKIN_DEPENDS: catkin_packages dependent projects also need catkin_package( CATKIN_DEPENDS message_runtime ) # include_directories(include) include_directories( ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ) ## Declare a cpp executable add_executable(image_converter src/image_converter.cpp) target_link_libraries ( image_converter ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} ) rules.bmr
class update_pximu_RawIMUData_0380911195329d307d8f033bc714dbbf(MessageUpdateRule): old_type = "pximu/RawIMUData" old_full_text = """ Header header # Measured accelerations (in x, y, z) Vector3f acc # Measured angular speeds (around x, y, z) Vector3f gyro # Measured magnetic field (around x , y, z) Vector3f mag ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: pximu/Vector3f float32 x float32 y float32 z """ new_type = "bag_analyser/RawIMUData" new_full_text = """ Header header # Measured accelerations (in x, y, z) Vector3f acc # Measured angular speeds (around x, y, z) Vector3f gyro # Measured magnetic field (around x , y, z) Vector3f mag ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: bag_analyser/Vector3f float32 x float32 y float32 z """ order = 0 migrated_types = [ ("Header","Header"),] valid = True def update(self, old_msg, new_msg): self.migrate(old_msg.header, new_msg.header) #No migration path between [Vector3f] and [Vector3f] new_msg.acc = self.get_new_class('bag_analyser/Vector3f')(old_msg.acc) #No migration path between [Vector3f] and [Vector3f] new_msg.gyro = self.get_new_class('bag_analyser/Vector3f')(old_msg.gyro) #No migration path between [Vector3f] and [Vector3f] new_msg.mag = self.get_new_class('bag_analyser/Vector3f')(old_msg.mag) class update_libks_ImageSet_b3ef08c9cff052c83f5039d098add069(MessageUpdateRule): old_type = "libks/ImageSet" old_full_text = """ Header header sensor_msgs/Image[] images ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: sensor_msgs/Image # This message contains an uncompressed image # (0, 0) is at top-left corner of image # Header header # Header timestamp should be acquisition time of image # Header frame_id should be optical frame of camera # origin of frame should be optical center of cameara # +x should point to the right in the image # +y should point down in the image # +z should point into to plane of the image # If the frame_id here and the frame_id of the CameraInfo # message associated with the image conflict # the behavior is undefined uint32 height # image height, that is, number of rows uint32 width # image width, that is, number of columns # The legal values for encoding are in file src/image_encodings.cpp # If you want to standardize a new string format, join # ros-users@lists.sourceforge.net and send an email proposing a new encoding. string encoding # Encoding of pixels -- channel meaning, ordering, size # taken from the list of strings in src/image_encodings.cpp uint8 is_bigendian # is this data bigendian? uint32 step # Full row length in bytes uint8[] data # actual matrix data, size is (step * rows) """ new_type = "bag_analyser/ImageSet" new_full_text = """ Header header sensor_msgs/Image[] images ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: sensor_msgs/Image # This message contains an uncompressed image # (0, 0) is at top-left corner of image # Header header # Header timestamp should be acquisition time of image # Header frame_id should be optical frame of camera # origin of frame should be optical center of cameara # +x should point to the right in the image # +y should point down in the image # +z should point into to plane of the image # If the frame_id here and the frame_id of the CameraInfo # message associated with the image conflict # the behavior is undefined uint32 height # image height, that is, number of rows uint32 width # image width, that is, number of columns # The legal values for encoding are in file src/image_encodings.cpp # If you want to standardize a new string format, join # ros-users@lists.sourceforge.net and send an email proposing a new encoding. string encoding # Encoding of pixels -- channel meaning, ordering, size # taken from the list of strings in include/sensor_msgs/image_encodings.h uint8 is_bigendian # is this data bigendian? uint32 step # Full row length in bytes uint8[] data # actual matrix data, size is (step * rows) """ order = 0 migrated_types = [ ("Header","Header"), ("sensor_msgs/Image","sensor_msgs/Image"),] valid = True def update(self, old_msg, new_msg): self.migrate(old_msg.header, new_msg.header) self.migrate_array(old_msg.images, new_msg.images, "sensor_msgs/Image") class update_pximu_AttitudeData_bc609da5ddac9016c096c67da33d8b9c(MessageUpdateRule): old_type = "pximu/AttitudeData" old_full_text = """ Header header # roll angle [rad] float32 roll # pitch angle [rad] float32 pitch # yaw angle [rad] float32 yaw # roll angular speed [rad/s] float32 rollspeed # pitch angular speed [rad/s] float32 pitchspeed # yaw angular speed [rad/s] float32 yawspeed ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id """ new_type = "bag_analyser/AttitudeData" new_full_text = """ Header header # roll angle [rad] float32 roll # pitch angle [rad] float32 pitch # yaw angle [rad] float32 yaw # roll angular speed [rad/s] float32 rollspeed # pitch angular speed [rad/s] float32 pitchspeed # yaw angular speed [rad/s] float32 yawspeed ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id """ order = 0 migrated_types = [ ("Header","Header"),] valid = True def update(self, old_msg, new_msg): self.migrate(old_msg.header, new_msg.header) new_msg.roll = old_msg.roll new_msg.pitch = old_msg.pitch new_msg.yaw = old_msg.yaw new_msg.rollspeed = old_msg.rollspeed new_msg.pitchspeed = old_msg.pitchspeed new_msg.yawspeed = old_msg.yawspeed
Doing **rosbag info** on the file shows: types: libks/ImageSet [b3ef08c9cff052c83f5039d098add069] pximu/AttitudeData [bc609da5ddac9016c096c67da33d8b9c] pximu/RawIMUData [0380911195329d307d8f033bc714dbbf] [...] topics: /attitude 2174 msgs : pximu/AttitudeData /capture 3282 msgs : libks/ImageSet /imu_raw 10873 msgs : pximu/RawIMUData [...] I cannot play the file with 'rosbag play', probably because rosbag doesn't know the message definitions. Therefore, I thought I needed to use migration(see http_wiki_ros_org/rosbag_migration) and provide custom message definitions (see http_wiki_ros_org/msg) and use them in a rule file. I made a new package 'bag_analyser", and added the custom messages to the 'msg' folder and compiled. E.g. for ImageSet I made a file ImageSet.msg:
Header header sensor_msgs/Image[] images This seems to work, e.g. for **' rosmsg show bag_analyser/ImageSet'** I get:
std_msgs/Header header uint32 seq time stamp string frame_id sensor_msgs/Image[] images std_msgs/Header header uint32 seq time stamp string frame_id uint32 height uint32 width string encoding uint8 is_bigendian uint32 step uint8[] data
I also made messages for RawIMUData and AttitudeData. Then I generated a rules file (rules.bmr, see full output at end), adjusted the rules that needed to be adjusted and executed: rosbag fix original_bag.bag converted_bag.bag rules.bmr which told me "bag migrated successfully". Doing **rosbag info** on the converted file gives me:
types: bag_analyser/AttitudeData [bc609da5ddac9016c096c67da33d8b9c] bag_analyser/ImageSet [b3ef08c9cff052c83f5039d098add069] bag_analyser/RawIMUData [0380911195329d307d8f033bc714dbbf] [...] topics: /attitude 2174 msgs : bag_analyser/AttitudeData /capture 3282 msgs : bag_analyser/ImageSet /imu_raw 10873 msgs : bag_analyser/RawIMUData My problem is that I still cannot read the file. I tried using **'rosbag play'** but it simply gives me: [ INFO] [1402332944.127314834]: Opening converted_bag.bag [FATAL] [1402332944.127848761]: Error opening file: converted_bag.bag I also tried reading in the file using the rosbag API, which also fails opening the file (code in image_converter.cpp below). I changed the bagfile's permissions and set it to allow read/write/execute just to make sure it wasn't that. **What am I doing wrong? How can I read the data from the file?** I am fairly new to ROS, so any help or tips are greatly appreciated!
**File listings:**
---------------------------------------- folder bag/analyser/msg
ImageSet.msg Header header sensor_msgs/Image[] images RawIMUData.msg Header header # Measured accelerations (in x, y, z) Vector3f acc # Measured angular speeds (around x, y, z) Vector3f gyro # Measured magnetic field (around x , y, z) Vector3f mag Vector3f.msg float32 x float32 y float32 z AttitudeData.msg Header header # roll angle [rad] float32 roll # pitch angle [rad] float32 pitch # yaw angle [rad] float32 yaw # roll angular speed [rad/s] float32 rollspeed # pitch angular speed [rad/s] float32 pitchspeed # yaw angular speed [rad/s] float32 yawspeed bag_analyser/image_converter.cpp ( includes message definition for ImageSet.h and tries to use rosbag API to read file):
#include
cmake_minimum_required(VERSION 2.8.3) project(bag_analyser) ## Find catkin macros and libraries find_package(catkin REQUIRED COMPONENTS cv_bridge image_transport message_generation roscpp rospy std_msgs rosbag ) ## System dependencies are found with CMake's conventions find_package(Boost REQUIRED COMPONENTS system) find_package( OpenCV REQUIRED ) ## Generate messages in the 'msg' folder add_message_files( FILES ImageSet.msg RawIMUData.msg Vector3f.msg AttitudeData.msg ) ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES std_msgs sensor_msgs ) ## CATKIN_DEPENDS: catkin_packages dependent projects also need catkin_package( CATKIN_DEPENDS message_runtime ) # include_directories(include) include_directories( ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ) ## Declare a cpp executable add_executable(image_converter src/image_converter.cpp) target_link_libraries ( image_converter ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} ) rules.bmr
class update_pximu_RawIMUData_0380911195329d307d8f033bc714dbbf(MessageUpdateRule): old_type = "pximu/RawIMUData" old_full_text = """ Header header # Measured accelerations (in x, y, z) Vector3f acc # Measured angular speeds (around x, y, z) Vector3f gyro # Measured magnetic field (around x , y, z) Vector3f mag ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: pximu/Vector3f float32 x float32 y float32 z """ new_type = "bag_analyser/RawIMUData" new_full_text = """ Header header # Measured accelerations (in x, y, z) Vector3f acc # Measured angular speeds (around x, y, z) Vector3f gyro # Measured magnetic field (around x , y, z) Vector3f mag ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: bag_analyser/Vector3f float32 x float32 y float32 z """ order = 0 migrated_types = [ ("Header","Header"),] valid = True def update(self, old_msg, new_msg): self.migrate(old_msg.header, new_msg.header) #No migration path between [Vector3f] and [Vector3f] new_msg.acc = self.get_new_class('bag_analyser/Vector3f')(old_msg.acc) #No migration path between [Vector3f] and [Vector3f] new_msg.gyro = self.get_new_class('bag_analyser/Vector3f')(old_msg.gyro) #No migration path between [Vector3f] and [Vector3f] new_msg.mag = self.get_new_class('bag_analyser/Vector3f')(old_msg.mag) class update_libks_ImageSet_b3ef08c9cff052c83f5039d098add069(MessageUpdateRule): old_type = "libks/ImageSet" old_full_text = """ Header header sensor_msgs/Image[] images ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: sensor_msgs/Image # This message contains an uncompressed image # (0, 0) is at top-left corner of image # Header header # Header timestamp should be acquisition time of image # Header frame_id should be optical frame of camera # origin of frame should be optical center of cameara # +x should point to the right in the image # +y should point down in the image # +z should point into to plane of the image # If the frame_id here and the frame_id of the CameraInfo # message associated with the image conflict # the behavior is undefined uint32 height # image height, that is, number of rows uint32 width # image width, that is, number of columns # The legal values for encoding are in file src/image_encodings.cpp # If you want to standardize a new string format, join # ros-users@lists.sourceforge.net and send an email proposing a new encoding. string encoding # Encoding of pixels -- channel meaning, ordering, size # taken from the list of strings in src/image_encodings.cpp uint8 is_bigendian # is this data bigendian? uint32 step # Full row length in bytes uint8[] data # actual matrix data, size is (step * rows) """ new_type = "bag_analyser/ImageSet" new_full_text = """ Header header sensor_msgs/Image[] images ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: sensor_msgs/Image # This message contains an uncompressed image # (0, 0) is at top-left corner of image # Header header # Header timestamp should be acquisition time of image # Header frame_id should be optical frame of camera # origin of frame should be optical center of cameara # +x should point to the right in the image # +y should point down in the image # +z should point into to plane of the image # If the frame_id here and the frame_id of the CameraInfo # message associated with the image conflict # the behavior is undefined uint32 height # image height, that is, number of rows uint32 width # image width, that is, number of columns # The legal values for encoding are in file src/image_encodings.cpp # If you want to standardize a new string format, join # ros-users@lists.sourceforge.net and send an email proposing a new encoding. string encoding # Encoding of pixels -- channel meaning, ordering, size # taken from the list of strings in include/sensor_msgs/image_encodings.h uint8 is_bigendian # is this data bigendian? uint32 step # Full row length in bytes uint8[] data # actual matrix data, size is (step * rows) """ order = 0 migrated_types = [ ("Header","Header"), ("sensor_msgs/Image","sensor_msgs/Image"),] valid = True def update(self, old_msg, new_msg): self.migrate(old_msg.header, new_msg.header) self.migrate_array(old_msg.images, new_msg.images, "sensor_msgs/Image") class update_pximu_AttitudeData_bc609da5ddac9016c096c67da33d8b9c(MessageUpdateRule): old_type = "pximu/AttitudeData" old_full_text = """ Header header # roll angle [rad] float32 roll # pitch angle [rad] float32 pitch # yaw angle [rad] float32 yaw # roll angular speed [rad/s] float32 rollspeed # pitch angular speed [rad/s] float32 pitchspeed # yaw angular speed [rad/s] float32 yawspeed ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id """ new_type = "bag_analyser/AttitudeData" new_full_text = """ Header header # roll angle [rad] float32 roll # pitch angle [rad] float32 pitch # yaw angle [rad] float32 yaw # roll angular speed [rad/s] float32 rollspeed # pitch angular speed [rad/s] float32 pitchspeed # yaw angular speed [rad/s] float32 yawspeed ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id """ order = 0 migrated_types = [ ("Header","Header"),] valid = True def update(self, old_msg, new_msg): self.migrate(old_msg.header, new_msg.header) new_msg.roll = old_msg.roll new_msg.pitch = old_msg.pitch new_msg.yaw = old_msg.yaw new_msg.rollspeed = old_msg.rollspeed new_msg.pitchspeed = old_msg.pitchspeed new_msg.yawspeed = old_msg.yawspeed
↧
What's the right way to call rosbag in a launch file?
Hi there,
Since the Python API for rosbag is not really documented, I've decided to just start a couple bags from a launch file. I want to record some topics from my robot, and some from my desktop system. Here's what I have so far:
I've tried a few different things based on forum posts and one other question on this site, to no avail. The errors I've been getting are along the lines of:
`Error writing: Error opening file: /cmd_vel.bag.active`
and `[robot_bag-1] process has died [pid 21226, exit code 1 ...`
↧
↧
Record tf_static with rosbag
Hi all,
I'm trying to record all my topics into a bag, running `rosbag record -a`. However, rosbag doesn't record the `/tf_static` topic.
How can I arrange this?
Thanks
↧
How do I best save a transform to a file?
Since it seems the rosbag C++ API doesn't work very well with the tf library, and I cannot find a simple way of saving ROS datatypes to files, I don't know how to best save a transform that I have calculated. I really need something that maintains the datatype, so that I won't need to make my own functions just to separately read position and orientation and so forth.
For what it's worth, I am considering using just a geometry_msgs::Quaternion and a geometry_msgs::Point and recreating the transform from those data. Any other recommendations?
↧
Synchronizetion of Gazebo-log and Rosbag replay
Hello.
I am interesting in recording and replaying simulated scenario in gazebo. I am looking to record both the simulated environment and the movement of my robot inside of it, and also my robot's Internal data (rostopics).
Best solution for me would be to run gazebo base on recorded **rosbag** file. But i suspect it is not possible as rosbag do not record simulated world environmental data.
I am familiar with **gazebo log**, but have no idea for how to synchronized it to play at same rate with to rosbag.
Is there any solution for this ?
Thanks
↧
Trouble Including rosbag
Hello, I am trying to follow this tutorial: http://wiki.ros.org/rosbag/Code%20API#cpp_api , but am running into errors with the inclusion of rosbag. When I try to run the example code, I get a jillion lines of errors all saying something like this: undefined reference to rosbag:somethingOrOther. However, I don't know what I'm doing wrong. I included rosbag/bag.h and rosbag/view.h in my C++ source file, and I believe I've linked the libraries correctly in my CMakelists file:
add_executable(rosbagger src/rosbagger.cpp)
target_link_libraries(rosbagger ${catkin_LIBRARIES})
Anyone know whats going wrong?
↧
↧
qt creator convert
hi,
i record with rosbag a viedeo. I want to viaualize the video in a gui, with a qt creator, but rosbag records only in the Format Mono_8, buti need a rgb format to play the video. How can i decode the video?
I try with this:
QImage temp(&( qnode.getThermalImage().data[0]), 320, 240, QImage::Format_Mono);
QImage image;
image = temp;
image = temp.convertToFormat(QImage::Format_RGB32);
ui.lbl_video->setPixmap(QPixmap::fromImage(image));
ui.lbl_video->update();
↧
How to launch rxbag or rqt_bag with the --clock option
Hello
I am launching the playback of a bag file using rosbag play.
Because I want to emulate the clock at the time of recording I use the --clock option along with the use_sim_time=true parameter
http://www.ros.org/wiki/Clock
The problem is I want tot use rxbag or rqt_bag instead of rosbag play.
None of those accept a --clock option.
I should I do it? run a clock server independently? How can I do it?
Thanks
Miguel
Update: No one answered my question. If it does not make sense please let me know. Basically, I just want to know how I can emulate the use_sim_time --clock options with rxbag or rqt_Bag.
Thanks
Miguel
↧
record rosrun tf tf_echo /map /base_link
I run tf tf_echo /map /base_link and compute exact data needed:
...
At time 1407419581.729
- Translation: [-8.999, -22.000, 0.000]
- Rotation: in Quaternion [-0.000, 0.000, 0.850. 0.526]
in RPY [0.000. -0.000, 2.034]
...
Is there a way to record this streaming data with rosbag record?
↧
created tf listener, how to rosbag?
I run `tf tf_echo /Pioneer3AT/map /Pioneer3AT/base_link` and compute exact data needed (so far so good):
...
At time 1407419581.729
- Translation: [-8.999, -22.000, 0.000]
- Rotation: in Quaternion [-0.000, 0.000, 0.850. 0.526]
in RPY [0.000. -0.000, 2.034]
...
I set up the following listener:
import roslib
import rospy
import tf
import sys, traceback
from nav_msgs.msg import Odometry
if __name__ == '__main__':
rospy.init_node('tf_P3AT')
listener = tf.TransformListener()
rate = rospy.Rate(10.0)
while not rospy.is_shutdown():
try:
now = rospy.Time(0)
(trans, rot) = listener.lookupTransform("/Pioneer3AT/map", "/Pioneer3AT/base_link", now)
except: (tf.LookupException, tf.ConnectivityException):
continue
print 'translation: ',trans
print 'rotation: ', rot
rate.sleep()
Prints out the correct data as above.
Next step: I would like to record this transform with rosbag.
Is this just a matter of publishing this data within my listener file, then running `rostopic echo`, then running `rosbag record`? Thanks for reading this.
↧
↧
Replay rosbags recorded with --split option
Hi,
I have recorded number of rosbags using --split option, say "file_0.bag", "file_1.bag", "file_2.bag" and so on to build a map. My question is: how to play them back one after the other. Using `$ rosbag play file_0.bag file_1.bag file_2.bag` plays all files at the same time. Whereas, I want to play one after another.
Thanks.
↧
can "rosbag filter" create a new bag file with multiple topics within it?
Hello,
I have a bagfile with a lot of topics in it.
For some reason I would like to filter out 4 topics of that bagfile into a new bagfile:
rosbag filter old_bag.bag new_bag.bag "topic=='/stereo/left/image_rect' '/stereo/right/image_rect' '/stereo/left/camera_info' '/stereo/right/camera_info'"
Unfortunately this doesn't work. Does anyone have a clue what the correct syntax is?
↧
[rosbag] Synchronisation between camera_info and image
Hello guys,
Quick question: My setup is Kinect => Depth Image => MoveIt =>Octomap
I want to record what's happening in the real world and to be able to replay it later on, so that the same octomap appears again. My idea was to record the depth image via rosbag and replay it later. Therefore I recorded `/camera/depth/image_raw` and `/camera/depth/camera_info`.
Now when I replay these topics to MoveIt, it complains like this:
[ WARN] [1411464286.696762717]: [image_transport] Topics '/camera_top/depth/image_raw' and '/camera_top/depth/camera_info' do not appear to be synchronized. In the last 10s:
Image messages received: 69
CameraInfo messages received: 237
Synchronized pairs: 0
How would I achieve such synchronisation?
Thanks in advance,
Rabe
↧