Skip to content

Commit efa11bb

Browse files
author
plnegre
committed
Merge branch 'indigo' of github.com:srv/srv_tools into indigo
2 parents ed0b506 + 82f7505 commit efa11bb

19 files changed

+149
-80
lines changed

bag_tools/scripts/add_header_time_offset.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -60,6 +60,7 @@ def add_offset(inbags, topics, offset):
6060

6161

6262
if __name__ == "__main__":
63+
rospy.init_node('add_header_time_offset')
6364
parser = argparse.ArgumentParser(
6465
description='Changes header timestamps using given offset, can change'
6566
'/tf as well.')

bag_tools/scripts/bag_add_time_offset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -66,7 +66,7 @@ def fix_bagfile(inbag, outbag, topics, offset):
6666
rospy.loginfo( '%s:%s messages.',k,v)
6767

6868
if __name__ == "__main__":
69-
69+
rospy.init_node('bag_add_time_offset')
7070
parser = argparse.ArgumentParser(
7171
description='Shift the publishing time of given topics in input bagfile.')
7272
parser.add_argument('-o', metavar='OUTPUT_BAGFILE', required=True, help='output bagfile')

bag_tools/scripts/batch_process.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -55,6 +55,7 @@ def process(in_dir,out_dir,command):
5555
subprocess.check_call(cmd)
5656

5757
if __name__ == "__main__":
58+
rospy.init_node('batch_process')
5859
parser = argparse.ArgumentParser(
5960
description='batch processes all bagfiles in INPUT_DIR, writing output to OUTPUT_DIR by calling given command with -i and -o arguments.')
6061
parser.add_argument('-i', metavar='INPUT_DIR', required=True, help='input directory with input bagfiles')

bag_tools/scripts/camera_info_parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -42,6 +42,7 @@ def parse_yaml(filename):
4242
cam_info = sensor_msgs.msg.CameraInfo()
4343
cam_info.width = calib_data['image_width']
4444
cam_info.height = calib_data['image_height']
45+
cam_info.header.frame_id = calib_data['camera_name']
4546
cam_info.K = calib_data['camera_matrix']['data']
4647
cam_info.D = calib_data['distortion_coefficients']['data']
4748
cam_info.R = calib_data['rectification_matrix']['data']
@@ -50,6 +51,7 @@ def parse_yaml(filename):
5051
return cam_info
5152

5253
if __name__ == "__main__":
54+
rospy.init_node('camera_info_parser')
5355
import argparse
5456
parser = argparse.ArgumentParser(description='Parses camera info yaml files and returns them as sensor_msgs.msg.CameraInfo.')
5557
parser.add_argument('filename', help='input yaml file')

bag_tools/scripts/change_camera_info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def replacement(replace_string):
8484
return pair[0], cam_info
8585

8686
if __name__ == "__main__":
87+
rospy.init_node('change_camera_info')
8788
parser = argparse.ArgumentParser(description='Change camera info messages in a bagfile.')
8889
parser.add_argument('inbag', help='input bagfile')
8990
parser.add_argument('outbag', help='output bagfile')

bag_tools/scripts/change_frame_id.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -55,7 +55,7 @@ def change_frame_id(inbag,outbag,frame_id,topics):
5555
outbag.close();
5656

5757
if __name__ == "__main__":
58-
58+
rospy.init_node('change_frame_id')
5959
parser = argparse.ArgumentParser(
6060
description='reate a new bagfile from an existing one replacing the frame id of requested topics.')
6161
parser.add_argument('-o', metavar='OUTPUT_BAGFILE', required=True, help='output bagfile')

bag_tools/scripts/change_topics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -63,6 +63,7 @@ def replacement(replace_string):
6363
return pair[0], pair[1]
6464

6565
if __name__ == "__main__":
66+
rospy.init_node('change_topics')
6667
parser = argparse.ArgumentParser(
6768
description='changes topic names inside a bagfile.')
6869
parser.add_argument('inbag', help='input bagfile')

bag_tools/scripts/check_delay.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def check_delay(inbags):
6868
rospy.loginfo('%s : mean = %s, min = %s, max = %s, median = %s', topic.ljust(max_len + 2), dmean, dmin, dmax, dmedian)
6969

7070
if __name__ == "__main__":
71+
rospy.init_node('check_delay')
7172
parser = argparse.ArgumentParser(
7273
description='Checks the delay in a bagfile between publishing (recording) '
7374
'time and the time stamp in the header (if exists). Prints '

bag_tools/scripts/cut.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -62,6 +62,7 @@ def cut(inbags, outbagfile, start, duration):
6262

6363

6464
if __name__ == "__main__":
65+
rospy.init_node('cut')
6566
parser = argparse.ArgumentParser(
6667
description='Cuts out a section from an input bagfile and writes it to an output bagfile')
6768
parser.add_argument('--inbag', help='input bagfile(s)', nargs='+', required=True)

bag_tools/scripts/extract_topics.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in the
1414
documentation and/or other materials provided with the distribution.
15-
* Neither the name of Systems, Robotics and Vision Group, University of
16-
the Balearican Islands nor the names of its contributors may be used to
17-
endorse or promote products derived from this software without specific
15+
* Neither the name of Systems, Robotics and Vision Group, University of
16+
the Balearican Islands nor the names of its contributors may be used to
17+
endorse or promote products derived from this software without specific
1818
prior written permission.
1919
2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -52,13 +52,14 @@ def extract_topics(inbag,outbag,topics):
5252
outbag.close();
5353

5454
if __name__ == "__main__":
55+
rospy.init_node('extract_topics')
5556
parser = argparse.ArgumentParser(
5657
description='Extracts topics from a bagfile into another bagfile.')
5758
parser.add_argument('inbag', help='input bagfile')
5859
parser.add_argument('outbag', help='output bagfile')
5960
parser.add_argument('topics', nargs='+', help='topics to extract')
6061
args = parser.parse_args()
61-
62+
6263
try:
6364
extract_topics(args.inbag,args.outbag,args.topics)
6465
except Exception, e:

0 commit comments

Comments
 (0)