Skip to content

Commit

Permalink
Added launch files for new ROS bag recording method
Browse files Browse the repository at this point in the history
  • Loading branch information
mjshiggins committed Oct 10, 2016
1 parent 064c9bf commit adf1bb6
Show file tree
Hide file tree
Showing 11 changed files with 539 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Each challenge will contain awesome prizes (cash and others) for the most effect
| 9/29/2016 | Sunny | 12:40 | 25G | 40G | [HTTP](http://bit.ly/udacity-dataset-2-1) | [Torrent](datasets/dataset.bag.tar.gz.torrent)| `33a10f7835068eeb29b2a3274c216e7d` |
| 10/3/2016 | Overcast | 58:53 | 124G | 183G | [HTTP](http://bit.ly/udacity-dataset-2-2) | [Torrent](datasets/dataset-2-2.bag.tar.gz.torrent) | `34362e7d997476ed972d475b93b876f3` |

####Isolated and Trimmed Driving Data
With the help of [Auro Robotics](http://www.aurobots.com/), compression, and selective recording, we now have considerably smaller datasets that will be available shortly. You can find instructions for these datasets, when available, in the /datasets/udacity_launch readme.

## Contributions
Here's a list of the projects we've open sourced from crowdsourced contributions:

Expand Down
Binary file added datasets/udacity_launch/3cameras in rviz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions datasets/udacity_launch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 2.8.3)
project(udacity_launch)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED)
catkin_package()


#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS auro_resources auro_resources_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

47 changes: 47 additions & 0 deletions datasets/udacity_launch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

Dataset download
================
Downlaod either the content of folders as needed or to donwload the
whole folder you can directly download the compressed file

Example: Contents of udacity-dataset-2-1 or udacity-dataset-2-1.tar.bz2

To utilize compressed image topics
=================================
You need the install the dependecy
$sudo apt-get install ros-indigo-image-transport*

To play back data
=================
copy the udacity_launch packagae to you catkin workspace,
compile and source so that it is reachable.

cd udacity-dataset-2-1
rosbag play --clock *.bag
roslaunch udacity_launch bag_play.launch
#For visulization
roslaunch udacity_launch rviz.launch

To log data in sperate bagfiles and compressed image
====================================================
roslaunch udacity_launch logging.launch bagPath:="/media/Data/UdacitySDC/udacity-datasetN"



To convert existing log to sperate bagfiles and compressed image
================================================================
rosbag play --clock old_single_huge_bagfile.bag
roslaunch udacity_launch logging.launch republish_raw2compressed_images:=true bagPath:="/media/Data/UdacitySDC/udacity-datasetN"


Compressed bagfiles
================================================================
Each of the bagfiles are already compressed, so there is no benefit
of compressing the folders to compressed file other than having a single file
for the whole folder.
The bagfiles decompress on the fly and may cause slower performance and you
may want to decompress them before you run, size would increase by around 10% only.

$rosbag decompress *.bag


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions datasets/udacity_launch/launch/bag_play.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!--
Author: Jit Ray Chowdhury ([email protected])
Last Update: 10-9-2019
Description: Launch logging of all usefull topics organized in speprarate bag files (logging.launch)
-->
<launch>
<param name="use_sim_time" value="true"/>


<include file="$(find scu_launch)/config/global_parameters.xml" />
<arg name="velodyne_packet2pointcloud" default="false" />
<arg name="velodyne_packets2pointcloud" default="false" />
<arg name="camera_compressed_to_full" default="true" />
<arg name="ackermann_cmd_from_trajectory_follow" default="true" />

<!-- velodyne_packet2pointcloud -->
<node pkg="velodyne_decoder" type="velodyne_decoder_node" name="velodyne_decoder" if="$(arg velodyne_packet2pointcloud)" >
<remap from="velodyne_point_cloud" to="velodyne_points" />
<param name="min_range" value="0.3"/>
<param name="max_range" value="150"/>
<param name="frequency" value="20"/>
<param name="publish_point_cloud" value="true"/>
</node>
<!-- velodyne_packets2pointcloud -->
<node pkg="velodyne_pointcloud" type="cloud_node" name="velodyne_pointcloud" if="$(arg velodyne_packets2pointcloud)" >
<param name="min_range" value="0.3"/>
<param name="max_range" value="150"/>
<param name="calibration" value="$(find velodyne_pointcloud)/params/VLP16db.yaml"/>
</node>
<!-- camera_compressed_to_full -->
<node pkg="image_transport" type="republish" name="republish_center_camera"
args="compressed in:=/center_camera/image_color raw out:=/center_camera/image_color" if="$(arg camera_compressed_to_full)"/>
<node pkg="image_transport" type="republish" name="republish_right_camera"
args="compressed in:=/right_camera/image_color raw out:=/right_camera/image_color" if="$(arg camera_compressed_to_full)"/>
<node pkg="image_transport" type="republish" name="republish_left_camera"
args="compressed in:=/left_camera/image_color raw out:=/left_camera/image_color" if="$(arg camera_compressed_to_full)"/>




</launch>
169 changes: 169 additions & 0 deletions datasets/udacity_launch/launch/logging.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<?xml version="1.0"?>
<!--
Author: Jit Ray Chowdhury ([email protected])
Last Update: 10-9-2019
Description: Launch logging of all usefull topics organized in speprarate bag files (logging.launch)
-->
<launch>
<!-- Destination bag file path and its folder structure -->
<arg name="bagPath" default="/media/Data/UdacitySDC/udacity-dataset1" />
<arg name="bagIdentifier" default="udacity-dataset" />

<!-- 'dataType' specifies which type of data we want to collect --> <!-- 1 to record else 0 -->
<!--Sensors-->

<arg name="record_velodyne_pointcloud" default="0" />
<arg name="record_velodyne_packet" default="1" />
<arg name="record_camera_images" default="1" />
<arg name="record_vehicle" default="1" />
<arg name="record_can_interface" default="1" />
<arg name="record_tf" default="1" />
<arg name="record_diagnostics" default="1" />

<arg name="republish_raw2compressed_images" default="0" />




<!-- RECORDING NODES -->

<!--Sensors-->

<!-- Records velodyne PointCloud -->
<group if="$(arg record_velodyne_pointcloud)">
<node name="record_velodyne_pointcloud" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_sensor_velodyne_pointcloud
/velodyne_points
/velodyne_point_cloud"
output="screen"/>
</group>
<!-- Records velodyne Packets -->
<group if="$(arg record_velodyne_packet)">
<node name="record_velodyne_packet" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_sensor_velodyne_packet
/velodyne_packets
/velodyne_packet"
output="screen"/>
</group>

<!-- Records the camera images -->
<group if="$(arg record_camera_images)">
<!-- compress images -->
<node pkg="image_transport" type="republish" name="republish_center_camera"
args="raw in:=/center_camera/image_color compressed out:=/center_camera/image_color" if="$(arg republish_raw2compressed_images)" />
<node pkg="image_transport" type="republish" name="republish_right_camera"
args="raw in:=/right_camera/image_color compressed out:=/right_camera/image_color" if="$(arg republish_raw2compressed_images)" />
<node pkg="image_transport" type="republish" name="republish_left_camera"
args="raw in:=/left_camera/image_color compressed out:=/left_camera/image_color" if="$(arg republish_raw2compressed_images)" />

<node name="record_camera_center" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_sensor_camera_center
/center_camera/image_color/compressed
/center_camera/image_color/camera_info
"
output="screen"/>
<node name="record_camera_left" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_sensor_camera_left
/left_camera/image_color/compressed
/left_camera/image_color/camera_info
"
output="screen"/>
<node name="record_camera_right" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_sensor_camera_right
/right_camera/image_color/compressed
/right_camera/image_color/camera_info
"
output="screen"/>
</group>

<!--IO-->
<!-- Records vehicle msgs -->
<group if="$(arg record_vehicle)">
<node name="record_vehicle" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_io_vehicle
/vehicle/brake_info_report
/vehicle/brake_report
/vehicle/dbw_enabled
/vehicle/filtered_accel
/vehicle/fuel_level_report
/vehicle/gear_report
/vehicle/gps/fix
/vehicle/gps/time
/vehicle/gps/vel
/vehicle/imu/data_raw
/vehicle/joint_states
/vehicle/misc_1_report
/vehicle/sonar_cloud
/vehicle/steering_report
/vehicle/surround_report
/vehicle/suspension_report
/vehicle/throttle_info_report
/vehicle/throttle_report
/vehicle/tire_pressure_report
/vehicle/twist_controller/parameter_descriptions
/vehicle/twist_controller/parameter_updates
/vehicle/wheel_speed_report
"
output="screen"/>
</group>

<!-- Records can interface -->
<group if="$(arg record_can_interface)">
<node name="record_can_interface" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_io_can_interface
/can_bus_dbw/can_rx
"
output="screen"/>
</group>




<!--Diagnostics and tf-->
<!-- Records the transforms -->
<group if="$(arg record_tf)">
<node name="record_tf" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_tf
/tf
/tf_static
"
output="screen"/>
</group>

<group if="$(arg record_diagnostics)">
<node name="record_diagnostics" pkg="rosbag" type="record" args="
--split
--size=3999
-o $(arg bagPath)/$(arg bagIdentifier)_diagnostics
/diagnostics
/diagnostics_agg
/diagnostics_toplevel_state"
output="screen"/>
</group>
</launch>










27 changes: 27 additions & 0 deletions datasets/udacity_launch/launch/record_video.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!--
Author: Jit Ray Chowdhury ([email protected])
Last Update: 10-9-2019
Description: Launch logging of all usefull topics organized in speprarate bag files (logging.launch)
-->
<launch>
<!-- may need sudo apt-get install ros-indigo-image-transport*
check with rosrun image_transport list_transports
https://coderwall.com/p/qewf6g/how-to-extract-images-from-a-rosbag-file-and-convert-them-to-video
-->
<!--
<node pkg="image_transport" type="republish" name="republish"
args="compressed in:=/sensors/camera/image_rect_color out:=/sensors/camera/image_rect_color_bag" />
-->

<node pkg="image_view" type="video_recorder" name="video_recorder" output="screen" >
<param name="stamped_filename" value="false" />
<param name="fps" value="30" />
<param name="codec" value="I420" />
<!--
<param name="encoding" value="bgr8" />
-->
<remap from="image" to="/sensors/camera/image_rect_color"/>
<param name="image_transport" type="string" value="compressed"/>
</node>
</launch>
14 changes: 14 additions & 0 deletions datasets/udacity_launch/launch/rviz.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!--
Author: Jit Ray Chowdhury ([email protected])
Last Update: 10-9-2019
Description: Launch logging of all usefull topics organized in speprarate bag files (logging.launch)
-->
<launch>

<!-- rviz -->
<arg name="rviz" default="true" />
<arg name="rviz_file" default="$(find udacity_launch)/rviz/disp.rviz" />
<node pkg="rviz" type="rviz" name="$(anon rviz)" args="-d $(arg rviz_file)" output="screen" if="$(arg rviz)"/>

</launch>
Loading

0 comments on commit adf1bb6

Please sign in to comment.