Skip to content

Commit

Permalink
data processing: making the scripts run with python3 (#768)
Browse files Browse the repository at this point in the history
* making the scripts run with python3

* making the source noetic instead of kinetic

* make script work in ubuntu 20

* reverting the header change
  • Loading branch information
marinagmoreira authored Apr 4, 2024
1 parent 8fbec63 commit dfacf7b
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 30 deletions.
2 changes: 1 addition & 1 deletion astrobee/scripts/cpu_print_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function deb_version {
fi
}

source /opt/ros/kinetic/setup.bash
source /opt/ros/noetic/setup.bash
date
echo "Kernel: $(uname -r)"
lsb_release -r
Expand Down
2 changes: 1 addition & 1 deletion hardware/pico_driver/scripts/debug_pico_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion hardware/pico_driver/scripts/pico_check_split_extended.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion hardware/pico_driver/scripts/pico_split_extended.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion hardware/pico_driver/scripts/pico_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion hardware/pico_driver/scripts/pico_write_xyz_coeff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
4 changes: 1 addition & 3 deletions localization/sparse_mapping/tools/generate_hugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,8 @@ def main():
srcImage.setFilename(img)
p.addImage(srcImage)

# make a c++ std::ofstream to write to
ofs = ofstream(output_hugin)
# write the modified panorama to that stream
p.writeData(ofs)
p.WritePTOFile(output_hugin)
# done with it
del ofs

Expand Down
14 changes: 10 additions & 4 deletions scripts/git/pre-commit.linter_python
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
Expand Down Expand Up @@ -71,12 +71,18 @@ echo " Analysing python code style with 'isort'."
# could happen for example if the .isort.cfg src_paths list gets out
# of date.

if $(isort . --extend-skip cmake,submodules --profile black --diff --check-only --quiet >/dev/null); then
isort_args=(
"--extend-skip=cmake"
"--extend-skip=submodules"
"--extend-skip=debian"
"--profile=black"
)
if $(isort . "${isort_args[@]}" --diff --check-only --quiet >/dev/null); then
echo "Linter checks using 'isort' passed."
else
echo "Errors detected with 'isort'. Fixing them. Try to add and commit your files again."
isort . --extend-skip cmake,submodules --profile black >/dev/null
failed_lint=true
isort . "${isort_args[@]}" >/dev/null
failed_lint=true
fi

# Cancel commit if linter failed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/check_bag_for_gaps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/clock_skew.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/csv_join.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/get_msg_stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_debayer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_detect_bad_topics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_fix_all.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_merge.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_rewrite_types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_sample.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_splice.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_topic_filter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_trim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/scripts/rosbag_verify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down
2 changes: 1 addition & 1 deletion tools/bag_processing/test/test_fix_all.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
Expand Down

0 comments on commit dfacf7b

Please sign in to comment.