diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cabf94e..b560628 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,18 +37,17 @@ jobs: name: "${{ matrix.distro }}${{ matrix.env.CLANG_TIDY && (github.event_name != 'workflow_dispatch' && ' • clang-tidy (delta)' || ' • clang-tidy (all)') || '' }}" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache ccache - uses: rhaschke/cache@main + uses: actions/cache@v4 with: + save-always: true path: ${{ env.CCACHE_DIR }} key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} restore-keys: | ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} ccache-${{ env.CACHE_PREFIX }} - env: - GHA_CACHE_SAVE: always - name: industrial_ci id: ici @@ -56,7 +55,7 @@ jobs: env: ${{ matrix.env || env }} - name: Upload test artifacts (on failure) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && (steps.ici.outputs.run_target_test || steps.ici.outputs.target_test_results) with: name: test-results diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 2d36665..c5fc02f 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -13,13 +13,13 @@ jobs: name: pre-commit runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install clang-format-10 run: sudo apt-get install clang-format-10 - uses: rhaschke/install-catkin_lint-action@v1.0 with: distro: noetic - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 id: precommit - name: Upload pre-commit changes if: failure() && steps.precommit.outcome == 'failure' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30520a2..6026aca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -28,12 +28,12 @@ repos: - id: trailing-whitespace - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.7 + rev: v2.0.4 hooks: - id: autopep8 - repo: https://github.com/PyCQA/pylint - rev: v2.11.1 + rev: v3.2.6 hooks: [] - repo: local diff --git a/tactile_calibration/tactile_calibration_tools/scripts/record_calib.py b/tactile_calibration/tactile_calibration_tools/scripts/record_calib.py index 4d2b493..83fbe55 100755 --- a/tactile_calibration/tactile_calibration_tools/scripts/record_calib.py +++ b/tactile_calibration/tactile_calibration_tools/scripts/record_calib.py @@ -22,12 +22,12 @@ from tactile_calibration_tools.calibration_utils import * -#import curses -#import os +# import curses +# import os -#import curses -#stdscr = curses.initscr() +# import curses +# stdscr = curses.initscr() # curses.noecho() # stdscr.nodelay(1) # set getch() non-blocking @@ -179,7 +179,7 @@ def wait_key_press(timeout): return True return False # def wait_key_press(win, timeout): - #now = rospy.Time.now() + # now = rospy.Time.now() # while((rospy.Time.now()-now).to_sec() < timeout): # try: # key = win.getkey() @@ -198,7 +198,7 @@ def user_menu(choices={'c': "continue", 'r': "retry", 's': "save", 'q': "quit wi letter_string += ") ?\n" # print "press c to continue, r to retry, d to detect a new channel, s to save and quit, or q to quit without saving" tcflush(sys.stdin, TCIFLUSH) - #user_choice = stdscr.getch() + # user_choice = stdscr.getch() return input(letter_string) @@ -208,7 +208,7 @@ def user_yesno(default=True): else: text = "y/[n] ?" tcflush(sys.stdin, TCIFLUSH) - while(1): + while (1): ret = input(text) if ret == "": return default @@ -355,7 +355,7 @@ def select_color(prev_raw, raw, threshold): raw_sub = message_filters.Subscriber(args.raw_topic, TactileState) ref_sub = message_filters.Subscriber(args.ref_topic, TactileState) ts = message_filters.ApproximateTimeSynchronizer([raw_sub, ref_sub], 10, 0.1, allow_headerless=False) - #ts = message_filters.TimeSynchronizer([raw_sub, ref_sub], 10) + # ts = message_filters.TimeSynchronizer([raw_sub, ref_sub], 10) ts.registerCallback(raw_ref_topic_cb) else: print("Initializing topic subscriber") @@ -479,7 +479,7 @@ def select_color(prev_raw, raw, threshold): print("Use the calibtool upright and press and release your selected channel evenly over", args.repetition, "iterations. \n\n") # display vector and detection level - #channel_display_str = display_channel(raw_previous_vec, raw_vec, args.detect_threshold) + # channel_display_str = display_channel(raw_previous_vec, raw_vec, args.detect_threshold) channel_display_str = display_channel_color(raw_previous_vec, raw_vec, args.detect_threshold) if channel_display_str is not None: print("\033[0m\r chan:", '\033[0m|'.join(channel_display_str), '\033[0m', end=' ') @@ -571,7 +571,7 @@ def select_color(prev_raw, raw, threshold): state = RecordingState.PROCESS print("\nrecording ended") else: - #display_raw_ref = display_channel_color([raw_previous_vec[i] for i in [detected_channel, args.ref_channel]] , [raw_vec[i] for i in [detected_channel, args.ref_channel] ], input_range_max) + # display_raw_ref = display_channel_color([raw_previous_vec[i] for i in [detected_channel, args.ref_channel]] , [raw_vec[i] for i in [detected_channel, args.ref_channel] ], input_range_max) # if display_raw_ref is not None: # print "\033[0m\r chan:",display_raw_ref[0],"\033[0mref:",display_raw_ref[1],"\033[0m Remaining time :", round(DEFAULT_RECORDING_DURATION-elapsed_time), if ref_topic_init is not None and ref_topic_init is True: diff --git a/tactile_calibration/tactile_calibration_tools/src/tactile_calibration_tools/calibration_utils.py b/tactile_calibration/tactile_calibration_tools/src/tactile_calibration_tools/calibration_utils.py index 4c7f91b..4088509 100644 --- a/tactile_calibration/tactile_calibration_tools/src/tactile_calibration_tools/calibration_utils.py +++ b/tactile_calibration/tactile_calibration_tools/src/tactile_calibration_tools/calibration_utils.py @@ -378,7 +378,7 @@ def generate_mapping_pwl(x, y, input_range_max, calib_channel, seg=4, no_extrapo xs = np.array(x) ys = np.array(y) - #ys = smooth(y_inc,100) + # ys = smooth(y_inc,100) pwlf_result = pwlf.PiecewiseLinFit(xs, ys) # request a fit with n points