From 4c36d841b5d7b2f21479b7e06751c2aeb0890c5f Mon Sep 17 00:00:00 2001 From: Robert Carlstrom Date: Sun, 2 Jul 2023 16:54:00 -0400 Subject: [PATCH 01/12] removed broken submodules --- src/pi/manipulators/TCA9555/.gitignore | 9 - src/pi/manipulators/TCA9555/LICENSE | 22 - src/pi/manipulators/TCA9555/README.md | 131 ---- src/pi/manipulators/TCA9555/requirements.txt | 2 - src/pi/manipulators/TCA9555/setup.cfg | 2 - src/pi/manipulators/TCA9555/setup.py | 33 - .../manipulators/TCA9555/tca9555/__init__.py | 1 - .../manipulators/TCA9555/tca9555/tca9555.py | 580 ------------------ src/pi/manipulators/launch/manip_launch.py | 20 - src/pi/manipulators/manipulators/__init__.py | 0 .../manipulators/manipulators/manip_tester.py | 37 -- .../manipulators/manipulators/manipulators.py | 63 -- src/pi/manipulators/package.xml | 18 - src/pi/manipulators/resource/manipulators | 0 src/pi/manipulators/setup.cfg | 4 - src/pi/manipulators/setup.py | 39 -- src/pi/manipulators/test/test_flake8.py | 25 - src/pi/manipulators/test/test_pep257.py | 23 - .../workflows/industrial_ci_action.yml | 16 - src/surface/ros2_video_streamer/.gitignore | 14 - src/surface/ros2_video_streamer/LICENSE | 21 - src/surface/ros2_video_streamer/README.md | 64 -- .../launch/ros2_video_streamer_node_launch.py | 89 --- .../launch/three_camera_launch.py | 43 -- src/surface/ros2_video_streamer/package.xml | 25 - .../resource/ros2_video_streamer | 0 .../ros2_video_streamer/__init__.py | 0 .../ros2_video_streamer_node.py | 167 ----- src/surface/ros2_video_streamer/setup.cfg | 4 - src/surface/ros2_video_streamer/setup.py | 39 -- .../ros2_video_streamer/test/test_flake8.py | 25 - .../ros2_video_streamer/test/test_pep257.py | 23 - 32 files changed, 1539 deletions(-) delete mode 100644 src/pi/manipulators/TCA9555/.gitignore delete mode 100644 src/pi/manipulators/TCA9555/LICENSE delete mode 100644 src/pi/manipulators/TCA9555/README.md delete mode 100644 src/pi/manipulators/TCA9555/requirements.txt delete mode 100644 src/pi/manipulators/TCA9555/setup.cfg delete mode 100644 src/pi/manipulators/TCA9555/setup.py delete mode 100644 src/pi/manipulators/TCA9555/tca9555/__init__.py delete mode 100644 src/pi/manipulators/TCA9555/tca9555/tca9555.py delete mode 100644 src/pi/manipulators/launch/manip_launch.py delete mode 100644 src/pi/manipulators/manipulators/__init__.py delete mode 100644 src/pi/manipulators/manipulators/manip_tester.py delete mode 100644 src/pi/manipulators/manipulators/manipulators.py delete mode 100644 src/pi/manipulators/package.xml delete mode 100644 src/pi/manipulators/resource/manipulators delete mode 100644 src/pi/manipulators/setup.cfg delete mode 100644 src/pi/manipulators/setup.py delete mode 100644 src/pi/manipulators/test/test_flake8.py delete mode 100644 src/pi/manipulators/test/test_pep257.py delete mode 100644 src/surface/ros2_video_streamer/.github/workflows/industrial_ci_action.yml delete mode 100644 src/surface/ros2_video_streamer/.gitignore delete mode 100644 src/surface/ros2_video_streamer/LICENSE delete mode 100644 src/surface/ros2_video_streamer/README.md delete mode 100644 src/surface/ros2_video_streamer/launch/ros2_video_streamer_node_launch.py delete mode 100644 src/surface/ros2_video_streamer/launch/three_camera_launch.py delete mode 100644 src/surface/ros2_video_streamer/package.xml delete mode 100644 src/surface/ros2_video_streamer/resource/ros2_video_streamer delete mode 100644 src/surface/ros2_video_streamer/ros2_video_streamer/__init__.py delete mode 100644 src/surface/ros2_video_streamer/ros2_video_streamer/ros2_video_streamer_node.py delete mode 100644 src/surface/ros2_video_streamer/setup.cfg delete mode 100644 src/surface/ros2_video_streamer/setup.py delete mode 100644 src/surface/ros2_video_streamer/test/test_flake8.py delete mode 100644 src/surface/ros2_video_streamer/test/test_pep257.py diff --git a/src/pi/manipulators/TCA9555/.gitignore b/src/pi/manipulators/TCA9555/.gitignore deleted file mode 100644 index 330d3d39..00000000 --- a/src/pi/manipulators/TCA9555/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# pyc -*.pyc -# pycharm -.idea/ -# eclipse -.project -.pydevproject -# egg-info folder -TCA9555.egg-info/ diff --git a/src/pi/manipulators/TCA9555/LICENSE b/src/pi/manipulators/TCA9555/LICENSE deleted file mode 100644 index 25a16a35..00000000 --- a/src/pi/manipulators/TCA9555/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2021 Pascal Wolf - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/src/pi/manipulators/TCA9555/README.md b/src/pi/manipulators/TCA9555/README.md deleted file mode 100644 index ff3a9c2e..00000000 --- a/src/pi/manipulators/TCA9555/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# TCA9555 - -*** - -## Introduction - -**TCA9555** is a Python module for interfacing the Texas Instruments [TCA9555](https://www.ti.com/lit/ds/symlink/tca9555.pdf) 16-bit I2C-based GPIO expander using a Raspberry Pi. -All public methods are **thread-safe** which allows for continuous reading / writing to the GPIO from mutliple threads. - -## Installation - -You have to have Python >= 2.7 with the following packages installed: - -- [wiringpi](https://github.com/WiringPi/WiringPi-Python) -- [bitstring](https://github.com/scott-griffiths/bitstring) - -To install these dependecies, open a terminal and type -```bash - -pip install wiringpi bitstring -``` -Then, to finally install **TCA9555**, move to the root folder and type -```bash - -python setup.py develop -``` - -which will install in development mode - -## Setup - -To use this module, you need to enable the I2C interface of your Raspberry Pi - -```bash - -sudo raspi-config -``` - -Navigate to the `advanced options - I2C` menu and select `enable`. Now you need to connect the Raspberry Pis I2C pinout to the respective TCA9555 pins -```bash - - Role | Rpi | TCA9555 -------|-----|-------- - SDA | 3 | 23 - SCL | 5 | 22 - GND | 6 | 12 - VCC | 5 | 24 -``` - -If you do not plan to set a custom address to your TCA9555, tie address pins A0, A1 & A2 to GND as well. This will result in an IC2-bus address of 0x20 (32). - -## Examples - -### Basic usage - -Below you'll find a selection of use-cases. To see all available methods, please check [here](https://github.com/leloup314/TCA9555/blob/master/tca9555/tca9555.py) - -```python - -# Import the class -from tca9555 import TCA9555 - -# Initialize with standard I2C-bus address of TCA9555 a.k.a 0x20 -gpio = TCA9555() - -# Print startup-config as human-readable -print(gpio.format_config()) - -# Set pins 0, 1, 2 as output -gpio.set_output(bits=(0,1,2)) - -# Write value 5 to bits 0, 1, 2 -gpio.int_to_bits(bits=(0,1,2), val=5) - -# Read value from bits 0, 1, 2 -print(gpio.int_from_bits(bits=(0,1,2))) # 5 - -# Check if bit 0 is high -gpio.is_high(0) - -# Set bit 1 and 2 -gpio.set_bits(bits=(1, 2)) - -# Unset bits 2 -gpio.unset_bits(bits=2) -``` - -### Multi-threaded usage - -A more advanced scenario is that certain pins of the GPIO expander are used to read a value, while others are used to set registers / logic levels of other ICs. -Such a scenario is shown below - -```python -# Imports -from tca9555 import TCA9555 -from threading import Thread, Event - -def continuous_read(pins): - """Read continuously from *pins* until *flag* is set""" - while not flag.is_set(): - res = gpio.int_from_bits(bits=pins) - print(res) - -# Initialize GPIO expander -gpio = TCA9555() - -# Initialize flag to stop thread -flag = Event() - -# Read 4 bit integer from pins 0 to 3 -read_pins = (0, 1, 2, 3) - -# Make thread -t = Thread(target=continuous_read, args=(read_pins,)) - -# Start thread -t.start() - -# Continue to use gpio to set other pins -gpio.set_bits(bits=(4, 7, 15)) -gpio.set_bits(bits=(5, 8, 11)) -gpio.unset_bits(bits=(4, 8, 15)) -gpio.int_to_bits(bits=(12, 13, 14), val=7) - -# Continue working... - -# Stop thread -flag.set() -t.join() -``` - diff --git a/src/pi/manipulators/TCA9555/requirements.txt b/src/pi/manipulators/TCA9555/requirements.txt deleted file mode 100644 index 9fcaa7ce..00000000 --- a/src/pi/manipulators/TCA9555/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -wiringpi -bitstring diff --git a/src/pi/manipulators/TCA9555/setup.cfg b/src/pi/manipulators/TCA9555/setup.cfg deleted file mode 100644 index b88034e4..00000000 --- a/src/pi/manipulators/TCA9555/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md diff --git a/src/pi/manipulators/TCA9555/setup.py b/src/pi/manipulators/TCA9555/setup.py deleted file mode 100644 index 1698214c..00000000 --- a/src/pi/manipulators/TCA9555/setup.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python -import sys -from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code - -version = '0.1' -author = 'Pascal Wolf' -author_email = 'wolf@physik.uni-bonn.de' - -with open('requirements.txt') as f: - required = f.read().splitlines() - -# Make dict to pass to setup -setup_kwargs = {'name': 'TCA9555', - 'version': version, - 'description': 'Module for interfacing TCA9555 16-bit I2C GPIO expander via Raspberry Pi', - 'url': 'https://github.com/leloup314/TCA9555', - 'license': 'MIT License', - 'long_description': '', - 'author': author, - 'maintainer': author, - 'author_email': author_email, - 'maintainer_email': author_email, - 'packages': find_packages(), - 'setup_requires': ['setuptools'], - 'install_requires': required, - 'include_package_data': True, # accept all data files and directories matched by MANIFEST.in or found in source control - 'package_data': {'': ['README.*', 'VERSION'], 'docs': ['*'], 'examples': ['*']}, - 'keywords': ['GPIO', 'Expander', 'TCA9555', 'Texas Instruments', 'I2C', 'Raspberry Pi'], - 'platforms': 'any' - } - -# Setup -setup(**setup_kwargs) diff --git a/src/pi/manipulators/TCA9555/tca9555/__init__.py b/src/pi/manipulators/TCA9555/tca9555/__init__.py deleted file mode 100644 index 471588d0..00000000 --- a/src/pi/manipulators/TCA9555/tca9555/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .tca9555 import TCA9555 diff --git a/src/pi/manipulators/TCA9555/tca9555/tca9555.py b/src/pi/manipulators/TCA9555/tca9555/tca9555.py deleted file mode 100644 index eeaaf09f..00000000 --- a/src/pi/manipulators/TCA9555/tca9555/tca9555.py +++ /dev/null @@ -1,580 +0,0 @@ -import wiringpi as wp -import bitstring as bs -from collections import Iterable -from functools import wraps -from threading import Event - - -def _event_lock(io_func): - """ - Decorator which allows the complete execution of *io_func* without a different - thread calling another io functions which are decorated with this decorator. - Uses threading.Event to make simply block other calls until done. - """ - - @wraps(io_func) - def wrapper(*args, **kwargs): - - # Wait for flag to indicate that its available - args[0]._device_available.wait() - - # Clear the available state and indicate we're now locking access - args[0]._device_available.clear() - - res = io_func(*args, **kwargs) - - # Make access available again - args[0]._device_available.set() - - return res - - return wrapper - - -class TCA9555(object): - """ - This class implements an interface to the 16-bit IO expander using the I2C-interface of a Raspberry Pi - - The TCA9555 consists of two 8-bit Configuration (input or output selection), Input Port, Output Port and - Polarity Inversion (active high or active low operation) registers which are also referred to as ports: - Port 0 covers the IO bits P[7:0], port 1 covers bits P[15:8] (P[17:10] in datasheet convention). The bit - representation of the bit states hardware-wise is big-endian: - - 128 == 0b10000000 == bit 7 high, all others low - 1 == 0b00000001 == bit 0 high, all others low - - The default of representing the bit states within this class is to order by actual bit indices - - '10000000' == bit 0 high, all others low - '00000001' == bit 7 high, all others low - - All public methods are thread-safe - """ - - # Internal registers of (port_0, port_1) - regs = { - # Registers holding the actual values of the pin levels - "input": (0x00, 0x01), - # Registers holding the target values of pin levels - "output": (0x02, 0x03), - # Registers holding the polarity (active-high or active-low) - "polarity": (0x04, 0x05), - # Registers holding whether the pins are configured as in- (1) or output (0) - "config": (0x06, 0x07), - } - - # Number of available io bits; bits are shared into ports - _n_io_bits = 16 - - # Number of bits of one port - _n_bits_per_port = 8 - - # Number of ports of TCA9555 - _n_ports = 2 - - def __init__(self, address=0x20, config=None): - """ - Initialize the connection to the chip and set the a configuration if given - - address: int - integer of the I2C address of the TCA9555 (default is 0x20 e.g. 32) - config: dict - dictionary holding register values which should be set - """ - - # I2C-bus address; 0x20 (32 in decimal) if all address pins A0=A1=A2 are low - self.address = address - - # Setup I2C-bus communication using wiringpi library - self.device_id = wp.wiringPiI2CSetup(self.address) - - # Quick check; if self.device_id == -1 an error occurred - if self.device_id == -1: - raise IOError( - "Failed to establish connection on I2C-bus address {}".format(hex(self.address)) - ) - - # Flag which indicates writing or reading condition - self._device_available = Event() - self._device_available.set() - - if config: - self.config = config - - @property - def device_busy(self): - return not self._device_available.is_set() - - @device_busy.setter - def device_busy(self, val): - raise ValueError("This is a read-only property") - - @property - @_event_lock - def io_state(self): - return self._get_state("input") - - @io_state.setter - @_event_lock - def io_state(self, state): - self._set_state("output", state) - - @property - def n_io_bits(self): - return self._n_io_bits - - @n_io_bits.setter - def n_io_bits(self, val): - raise ValueError("This is a read-only property") - - @property - def n_bits_per_port(self): - return self._n_bits_per_port - - @n_bits_per_port.setter - def n_bits_per_port(self, val): - raise ValueError("This is a read-only property") - - @property - def n_ports(self): - return self._n_ports - - @n_ports.setter - def n_ports(self, val): - raise ValueError("This is a read-only property") - - @property - @_event_lock - def config(self): - return {reg: self._get_state(reg) for reg in self.regs} - - @config.setter - @_event_lock - def config(self, config): - for reg, val in config.items(): - self._set_state(reg, val) - - def _write_reg(self, reg, data): - """ - Writes one byte of *data* to register *reg* - reg: int - register value to write byte to - data: 8 bit - 8 bit of data to write - - Returns - ------- - Integer indicating successful write - """ - return wp.wiringPiI2CWriteReg8(self.device_id, reg, data) - - def _read_reg(self, reg): - """ - Reads one byte of *data* from register *reg* - - Parameters - ---------- - reg: int - register value to write byte to - - Returns - ------- - 8 bit of data read from *reg* - """ - return wp.wiringPiI2CReadReg8(self.device_id, reg) - - def _create_state(self, state, bit_length): - """ - Method to create a BitArray which represents the desired *state* of *bit_length* bits - - Parameters - ---------- - state: BitArray, int, str, Iterable - state from which to create a BitArray - bit_length: int - length of the state - """ - if isinstance(state, bs.BitArray): - pass - - elif isinstance(state, int): - state = bs.BitArray("uint:{}={}".format(bit_length, state)) - - elif isinstance(state, Iterable): - state = bs.BitArray(state) - - else: - raise ValueError( - "State must be integer, string or BitArray representing {} bits".format(bit_length) - ) - - if len(state) != bit_length: - raise ValueError("State must be {}} bits".format(bit_length)) - - return state - - def _check_register(self, reg): - """ - Checks if the register *reg* exists - - Parameters - ---------- - reg: str - String of register name whose existence is checked - """ - if reg not in self.regs: - raise ValueError( - "Register {} does not exist. Available registers: {}".format( - reg, ", ".join(self.regs.keys()) - ) - ) - - def _check_bits(self, bits, val=None): - """ - Checks if the an operation on the IO bits is valid - - Parameters - ---------- - bits: int, Iterable of ints - Iterable of bits on which an operation is performed - val: int, None - If not None, *val* must be an integer with bit length <= number of bits e.g. len(*bits*) - """ - bits = bits if isinstance(bits, Iterable) else [bits] - - if any(not 0 <= b < self._n_io_bits for b in bits): - raise IndexError( - "{}'s {} bits are indexed from {} to {}".format( - self.__class__.__name__, self._n_io_bits, 0, self._n_io_bits - 1 - ) - ) - - if len(set(bits)) != len(bits): - raise IndexError("Duplicate bit indices! *bits* must be composed of unique bit indices") - - if val: - if val.bit_length() > len(bits): - raise ValueError( - "Too little bits. Bit length of value {} is {}, the number of bits is {}".format( - val, val.bit_length(), len(bits) - ) - ) - - return bits - - def _set_bits(self, reg, val=1, bits=None): - """ - Get the current state of an individual port of the TCA9555 - - Parameters - ---------- - reg: str - Name of register whose state will be read - val: int, bool - Either 0 or 1 - bits: Iterable, int - bits to set to *val* - """ - if val not in (0, 1, True, False): - raise ValueError("'val' can only be 1 or 0") - - if bits is not None: - # Check if bit indices and values are fine - bits = self._check_bits(bits=bits) - - # Get current io configuration state - state = self._get_state(reg=reg) - - # Loop over state and set bits - for bit in bits: - state[bit] = val - - # Set state - self._set_state(reg, state) - - else: - # Set all pins to *val* - self._set_state(reg, [val] * self._n_io_bits) - - def _set_state(self, reg, state): - """ - Set the *state* to the register *reg* - - Parameters - ---------- - reg: str - Name of register whose state will be set - state: BitString, Iterable, str - Value from which a BitString-representation of *state* can be created - """ - # Create empty target register state - target_reg_state = self._create_state(state, self._n_io_bits) - - # loop over individual ports - for port in range(self._n_ports): - - # Compare individual current port states with target port states - target_port_state = target_reg_state[ - port * self._n_bits_per_port : (port + 1) * self._n_bits_per_port - ] - - # If target and current state differ, write - if target_port_state != self._get_port_state(reg=reg, port=port): - self._set_port_state(reg=reg, port=port, state=target_port_state) - - def _set_port_state(self, reg, port, state): - """ - Get the current state of an individual port of the TCA9555 - - Parameters - ---------- - reg: str - Name of register whose state will be set - port: int - Index of the port; either 0 or 1 - state: BitString, Iterable, str, int - Value from which a BitString-representation of *state* can be created - """ - # Check if register exists - self._check_register(reg) - - if port not in (0, 1): - raise IndexError("*port* must be index of physical port; either 0 or 1") - - target_state = self._create_state(state=state, bit_length=self._n_bits_per_port) - - # Match bit order with physical pin order, increasing left to right - target_state.reverse() - - self._write_reg(reg=self.regs[reg][port], data=target_state.uint) - - def _get_state(self, reg): - """ - Get the *state* to the register *reg* - - Parameters - ---------- - reg: str - Name of register whose state will be read - """ - return sum([self._get_port_state(reg=reg, port=port) for port in range(self._n_ports)]) - - def _get_port_state(self, reg, port): - """ - Get the current state of an individual port of the TCA9555 - - Parameters - ---------- - reg: str - Name of register whose state will be read - port: int - Index of the port; either 0 or 1 - """ - # Check if register exists - self._check_register(reg) - - if port not in (0, 1): - raise IndexError("*port* must be index of physical port; either 0 or 1") - - # Read port state - port_state = self._create_state( - state=self._read_reg(reg=self.regs[reg][port]), - bit_length=self._n_bits_per_port, - ) - - # Match bit order with physical pin order, increasing left to right - port_state.reverse() - - return port_state - - @_event_lock - def int_to_bits(self, bits, val): - """ - Method to set *bits* to state that represents *val* - - Parameters - ---------- - bits: Iterable, int - bits which represent value *val* - val: int - Integer which should be represented though *bits* binary state - """ - # Get the actual logic levels which are applied to the pins - state = self._get_state("input") - - # Create state for set of bits - val_bits = self._create_state(state=val, bit_length=len(bits)) - - # Match bit order with physical pin order, increasing left to right - val_bits.reverse() - - # Update current io state - for i, bit in enumerate(bits): - state[bit] = val_bits[i] - - # Set the updated state - self._set_state("output", state) - - def int_from_bits(self, bits): - """ - Method to get binary value from a set of *bits* - - Parameters - ---------- - bits: Iterable, int - bits from which to read the integer - """ - # Get the actual logic levels which are applied to the pins - state = self.io_state - - # Read the respective bit values - val_bits = bs.BitArray([state[bit] for bit in bits]) - - # Match bit order with physical pin order, increasing left to right - val_bits.reverse() - - return val_bits.uint - - @_event_lock - def set_state(self, reg, state): - """ - Thread-safe version of the private *_set_state*-method - - Parameters - ---------- - reg: str - Name of register whose state will be set - state: BitString, Iterable, str - Value from which a BitString-representation of *state* can be created - """ - self._set_state(reg=reg, state=state) - - @_event_lock - def set_port_state(self, reg, port, state): - """ - Thread-safe version of the private *_set_port_state*-method - - Parameters - ---------- - reg: str - Name of register whose state will be set - port: int - Index of the port; either 0 or 1 - state: BitString, Iterable, str, int - Value from which a BitString-representation of *state* can be created - """ - self._set_port_state(reg=reg, port=port, state=state) - - @_event_lock - def get_state(self, reg): - """ - Thread-safe version of the private *_get_state*-method - - Parameters - ---------- - reg: str - Name of register whose state will be read - """ - self._get_state(reg=reg) - - @_event_lock - def get_port_state(self, reg, port): - """ - Thread-safe version of the private *_get_port_state*-method - - Parameters - ---------- - reg: str - Name of register whose state will be read - port: int - Index of the port; either 0 or 1 - """ - self._get_port_state(reg=reg, port=port) - - def is_high(self, bit): - """ - Method to get logical state of single bit - - Parameters - ---------- - bit: int - bit from which to read the state - """ - self._check_bits(bits=bit) - - return self.io_state[bit] - - @_event_lock - def set_direction(self, direction, bits=None): - """ - Convenience-method to set direction of bits: input (1) or output (0) - - Parameters - ---------- - direction: int - 1 for input, 0 for output - bits: Iterable, int, None - bits for which the direction will be set - """ - self._set_bits(reg="config", val=int(bool(direction)), bits=bits) - - @_event_lock - def set_polarity(self, polarity, bits=None): - """ - Convenience-method to set polarity of bits: active-high (0) or active-low (1) - - Parameters - ---------- - polarity: int - 1 for inversion, 0 for default - bits: Iterable, int, None - bits for which the polarity will be set - """ - self._set_bits(reg="polarity", val=int(bool(polarity)), bits=bits) - - @_event_lock - def set_level(self, level, bits=None): - """ - Convenience-method to set logic-level of bits - - Parameters - ---------- - level: int - 1 for logical high, 0 for logic 0 - bits: Iterable, int, None - bits for which the level will be set - """ - self._set_bits(reg="output", val=int(bool(level)), bits=bits) - - def format_config(self, format_="bin"): - """ - Method returning a more readable version of self.config - - Parameters - ---------- - format_: str - Any attribute of BitArray-class - """ - return {reg: getattr(state, format_) for reg, state in self.config.items()} - - def set_bits(self, bits=None): - """ - Convenience-method to set bits e.g. set the output level to logical 1 - - Parameters - ---------- - bits: Iterable, int, None - bits of *reg* which will be set (to 1) - """ - self.set_level(level=1, bits=bits) - - def unset_bits(self, bits=None): - """ - Convenience-method to unset *bits* e.g. set the output level to logical 0 - - Parameters - ---------- - bits: Iterable, int, None - bits of *reg* which will be unset (to 0) - """ - self.set_level(level=0, bits=bits) diff --git a/src/pi/manipulators/launch/manip_launch.py b/src/pi/manipulators/launch/manip_launch.py deleted file mode 100644 index b1196ce5..00000000 --- a/src/pi/manipulators/launch/manip_launch.py +++ /dev/null @@ -1,20 +0,0 @@ -from launch import LaunchDescription -from launch_ros.actions import Node - - -def generate_launch_description(): - - manip_node = Node( - package="manipulators", - executable="manipulator", - parameters=[ - {"claw0": 0}, - {"claw1": 1}, - {"light": 2}, - ], - remappings=[("/pi/manipulator_control", "/manipulator_control")] - ) - - return LaunchDescription([ - manip_node - ]) diff --git a/src/pi/manipulators/manipulators/__init__.py b/src/pi/manipulators/manipulators/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/pi/manipulators/manipulators/manip_tester.py b/src/pi/manipulators/manipulators/manip_tester.py deleted file mode 100644 index d655f018..00000000 --- a/src/pi/manipulators/manipulators/manip_tester.py +++ /dev/null @@ -1,37 +0,0 @@ - -""" -Need to run this command. - -sudo chmod a+rw /dev/i2c-* -link to permanant solution -this solution worked -https://unix.stackexchange.com/questions/147494/how-can-i-set-device-rw-permissions-permanently-on-raspbian -""" - -from manipulators.tca9555 import TCA9555 -import time - - -def main(): - # Initialize with standard I2C-bus address of TCA9555 a.k.a 0x20 - gpio = TCA9555() # can put in the address as a param in hexadecimal - - # # Print :startup-config as human-readable - print(gpio.format_config()) - - # # Set pins 0 through 5 as output - gpio.set_direction(0, bits=(0, 1, 2, 3, 4, 5)) - print(gpio.format_config()) - - # Turn on the LEDs - gpio.set_bits(bits=(0, 1, 2, 3, 4, 5)) - print(gpio.format_config()) - time.sleep(5) - - # # Turn off the LEDs - gpio.unset_bits(bits=(0, 1, 2, 3, 4, 5)) - print(gpio.format_config()) - - -if __name__ == "__main__": - main() diff --git a/src/pi/manipulators/manipulators/manipulators.py b/src/pi/manipulators/manipulators/manipulators.py deleted file mode 100644 index f86827ee..00000000 --- a/src/pi/manipulators/manipulators/manipulators.py +++ /dev/null @@ -1,63 +0,0 @@ -import rclpy -from rclpy.node import Node, Subscription -from interfaces.msg import Manip -from manipulators.tca9555 import TCA9555 - - -class Manipulator(Node): - - def __init__(self): - super().__init__('manipulator', - parameter_overrides=[]) - - self.subscription: Subscription = self.create_subscription( - Manip, - 'manipulator_control', - self.manip_callback, - 100 - ) - - self.declare_parameters( - namespace="", - parameters=[ - ("claw0", rclpy.Parameter.Type.INTEGER), - ("claw1", rclpy.Parameter.Type.INTEGER), - ("light", rclpy.Parameter.Type.INTEGER), - ]) - - # Initialize with standard I2C-bus address of TCA9555 a.k.a 0x20 - self.gpio = TCA9555() # can put in the address as a param in hexadecimal - self.get_logger().info(str(self.gpio.format_config())) - - # Set pins 0 through 5 as output - self.gpio.set_direction(0, bits=(0, 1, 2, 3, 4, 5)) - self.gpio.unset_bits(bits=(0, 1, 2, 3, 4, 5)) - - def manip_callback(self, request: Manip): - manip_id = request.manip_id - activated = request.activated - - pin = self._parameters[manip_id].get_parameter_value().integer_value - - if activated: - self.gpio.set_bits(bits=(pin)) - else: - self.gpio.unset_bits(bits=(pin)) - - -def main(): - rclpy.init() - - subscriber = Manipulator() - - rclpy.spin(subscriber) - - # Destroy the node explicitly - # (optional - otherwise it will be done automatically - # when the garbage collector destroys the node object) - subscriber.destroy_node() - rclpy.shutdown() - - -if __name__ == '__main__': - main() diff --git a/src/pi/manipulators/package.xml b/src/pi/manipulators/package.xml deleted file mode 100644 index 6fb3f780..00000000 --- a/src/pi/manipulators/package.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - manipulators - 0.0.0 - Code for manipulators. - Michael Carlstrom - Apache License, Version 2.0 - - ament_copyright - ament_flake8 - ament_pep257 - python3-pytest - python-bitstring-pip - - ament_python - - diff --git a/src/pi/manipulators/resource/manipulators b/src/pi/manipulators/resource/manipulators deleted file mode 100644 index e69de29b..00000000 diff --git a/src/pi/manipulators/setup.cfg b/src/pi/manipulators/setup.cfg deleted file mode 100644 index 80e19e18..00000000 --- a/src/pi/manipulators/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[develop] -script_dir=$base/lib/manipulators -[install] -install_scripts=$base/lib/manipulators diff --git a/src/pi/manipulators/setup.py b/src/pi/manipulators/setup.py deleted file mode 100644 index 5c6cf587..00000000 --- a/src/pi/manipulators/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -import os -from glob import glob -from setuptools import setup -import sys - - -major_num = sys.version_info[0] -minor_num = sys.version_info[1] - -package_name = 'manipulators' - -setup( - name=package_name, - version='0.0.0', - packages=[package_name], - data_files=[ - ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), - # Include all launch files. - (os.path.join('share', package_name, 'launch'), - glob('launch/*launch.[pxy][yma]*')), - (os.path.join('lib', f'python{major_num}.{minor_num}', 'site-packages', package_name), - glob(os.path.join('TCA9555', 'tca9555', 'tca9555.py'))), - ], - install_requires=['setuptools', 'bitstring', 'wiringpi'], - zip_safe=True, - maintainer='taz', - maintainer_email='tzupfer@gmail.com', - description='Code for manipulators', - license='Apache 2.0', - tests_require=['pytest'], - entry_points={ - 'console_scripts': [ - 'manipulator = manipulators.manipulators:main', - 'test = manipulators.manip_tester:main' - ], - }, -) diff --git a/src/pi/manipulators/test/test_flake8.py b/src/pi/manipulators/test/test_flake8.py deleted file mode 100644 index 27ee1078..00000000 --- a/src/pi/manipulators/test/test_flake8.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_flake8.main import main_with_errors -import pytest - - -@pytest.mark.flake8 -@pytest.mark.linter -def test_flake8(): - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ - '\n'.join(errors) diff --git a/src/pi/manipulators/test/test_pep257.py b/src/pi/manipulators/test/test_pep257.py deleted file mode 100644 index b234a384..00000000 --- a/src/pi/manipulators/test/test_pep257.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2015 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_pep257.main import main -import pytest - - -@pytest.mark.linter -@pytest.mark.pep257 -def test_pep257(): - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' diff --git a/src/surface/ros2_video_streamer/.github/workflows/industrial_ci_action.yml b/src/surface/ros2_video_streamer/.github/workflows/industrial_ci_action.yml deleted file mode 100644 index 02311180..00000000 --- a/src/surface/ros2_video_streamer/.github/workflows/industrial_ci_action.yml +++ /dev/null @@ -1,16 +0,0 @@ -# https://github.com/ros-industrial/industrial_ci/blob/master/README.rst#id7 -name: Continuous Integration - -on: push - -jobs: - industrial_ci: - strategy: - matrix: - env: - - {ROS_DISTRO: galactic, ROS_REPO: main} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: 'ros-industrial/industrial_ci@master' - env: ${{matrix.env}} diff --git a/src/surface/ros2_video_streamer/.gitignore b/src/surface/ros2_video_streamer/.gitignore deleted file mode 100644 index 56ce3758..00000000 --- a/src/surface/ros2_video_streamer/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -*.mp4 -.Python -.idea/ -bin/ -build/ -camera_simulator.egg-info/ -dist/ -include/ -install/ -log/ -*/__pycache__/ -*.pyc -src/camera_simulator.egg-info/ -lib/ \ No newline at end of file diff --git a/src/surface/ros2_video_streamer/LICENSE b/src/surface/ros2_video_streamer/LICENSE deleted file mode 100644 index 7f238f94..00000000 --- a/src/surface/ros2_video_streamer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Andreas Klintberg - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/src/surface/ros2_video_streamer/README.md b/src/surface/ros2_video_streamer/README.md deleted file mode 100644 index 907b215f..00000000 --- a/src/surface/ros2_video_streamer/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# ros2_video_streamer - -A ROS2 python node for streaming video files or images to a topic. -Tailored launch file for 2024 MATE ROV competition. - -## CWRUBotix MATE ROV 2024 - -Use the `three_camera_launch.py` launch file without any parameters to launch -three streams from the files `bottom_cam.mp4`, `front_cam.mp4`, and -`manip_cam.mp4`. These files are not included in the Git repo to save space, -so you need to manually place three video files with those names in -`src/ros2_video_streamer`. - -```bash -ros2 launch ros2_video_streamer three_camera_launch.py -``` - -This launcher will publish the streams on `bottom_cam/image_raw`, -`front_cam/image_raw`, and `manip_cam/image_raw`. - -If greater control is desired, see __Custom Usage__. - -## Custom Usage - -Minimally, you need to provide the `ros2_video_streamer_node_launch.py` launch -file a `type` (`video` or `image`) and `path`, or `type:=video` and `camera_name`. -`path` is the path to the content to stream (relative to the ros2_video_streamer -package directory), and `camera_name` is the name of a camera (e.g. `front_cam`) -which the launch file uses to autofill various fields, including path, which it -sets to `.mp4`. - -```bash -ros2 launch ros2_video_streamer ros2_video_streamer_node_launch.py type:=video camera_name:= -``` - -```bash -ros2 launch ros2_video_streamer ros2_video_streamer_node_launch.py type:= path:= -``` - -The content is published on the `/simulated_cam/image_raw` topic by default, -but specifying `camera_name` will switch the topic to `//image_raw`. - -## All Settings -These are all of the parameters which the launch file accepts. - -* __camera_name__ - name of the camera (defaults to `simulated_cam`) which is - used as the node namespace and autopopulates the following fields: - * __image_topic_name__: `//image_raw` - * __info_topic_name__: `//camera_info` - * __path__: `.mp4` - -* __node_name__ - Override the default name of the node. - -* __image_topic_name__ - Override default name of the topic to publish images to - -* __info_topic_name__ - Override default name of the topic to publish camera info to - -* __config_file_name__ - Name of YAML file in the `config` folder. `CameraInfo` messages are published on the `~/camera_info` topic based on the content of the config file. By default, nothing is published. - -* __loop__ (_true_ or _false_; defaults to _true_) - Continuously publish the source on loop - -* __frame_id__ - Frame id string in the `CameraInfo` messages. - -* __start__ (_int_) - Location to start publishing the source. diff --git a/src/surface/ros2_video_streamer/launch/ros2_video_streamer_node_launch.py b/src/surface/ros2_video_streamer/launch/ros2_video_streamer_node_launch.py deleted file mode 100644 index 4010b2c7..00000000 --- a/src/surface/ros2_video_streamer/launch/ros2_video_streamer_node_launch.py +++ /dev/null @@ -1,89 +0,0 @@ -import launch -from launch_ros.actions import Node -from launch.substitutions import LaunchConfiguration -from launch.actions import DeclareLaunchArgument, OpaqueFunction -from launch.launch_context import LaunchContext -from typing import Tuple, Dict, Any - - -def generate_launch_description(): - """Launch streamer node with description from launch_setup.""" - # Using OpaqueFunction lets us access the launch context to evaluate - # params early - return launch.LaunchDescription([ - OpaqueFunction(function=launch_setup) - ]) - - -# TODO remove args and kwargs? -def launch_setup(context: LaunchContext, *args: Tuple[Any], **kwargs: Dict[Any, Any]): - """Generate array to be included in launch description.""" - # Declare and early evaluate camera_name argument - # Only strictly necessary to set streamer node name & namespace, - # but makes other substitutions nicer too - camera_name_argument: DeclareLaunchArgument = DeclareLaunchArgument( - 'camera_name', default_value='simulated_cam', - description='Name of the camera, used to autogenerate' + - '`image_topic_name`, `info_topic_name`, & `file_name`. Will find video' + - 'files named `.mp4`.') - camera_name_str = LaunchConfiguration('camera_name').perform(context) - - launch_arguments: list[DeclareLaunchArgument] = [ - DeclareLaunchArgument( - 'node_name', default_value='streamer_node' - ), - DeclareLaunchArgument( - 'image_topic_name', - default_value=f'/{camera_name_str}/image_raw' - ), - DeclareLaunchArgument( - 'info_topic_name', - default_value=f'/{camera_name_str}/camera_info' - ), - DeclareLaunchArgument( - 'config_file_name', default_value='', - description='Name of the config file. Defaults to empty string, which' + - 'means no config file. Contents published on `CameraInfo` message.' - ), - DeclareLaunchArgument( - 'loop', default_value='true' - ), - DeclareLaunchArgument( - 'frame_id', default_value='', - description='`frame_id` field in the `CameraInfo` topic' - ), - DeclareLaunchArgument( - 'type', description='Type of media source, (e.g. image or video)' - ), - DeclareLaunchArgument( - 'file_name', default_value=f'{camera_name_str}.mp4', - description='Name of file' - ), - DeclareLaunchArgument( - 'start', default_value='0', - description='Where the Video is starting from default is frame 0' - ) - ] - - streamer_node: Node = Node( - package='ros2_video_streamer', - executable='ros2_video_streamer_node', - name='streamer_node', - namespace=f'simulation/{camera_name_str}', - parameters=[ - {'config_file_path': LaunchConfiguration('config_file_name')}, - {'image_topic_name': LaunchConfiguration('image_topic_name')}, - {'info_topic_name': LaunchConfiguration('info_topic_name')}, - {'loop': LaunchConfiguration('loop')}, - {'frame_id': LaunchConfiguration('frame_id')}, - {'type': LaunchConfiguration('type')}, - {'file_name': LaunchConfiguration('file_name')}, - {'start': LaunchConfiguration('start')} - ] - ) - - return [ - camera_name_argument, - *launch_arguments, - streamer_node - ] diff --git a/src/surface/ros2_video_streamer/launch/three_camera_launch.py b/src/surface/ros2_video_streamer/launch/three_camera_launch.py deleted file mode 100644 index 57eb2e41..00000000 --- a/src/surface/ros2_video_streamer/launch/three_camera_launch.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -from ament_index_python.packages import get_package_share_directory -import launch -from launch.actions import IncludeLaunchDescription -from launch.launch_description_sources import PythonLaunchDescriptionSource - - -def generate_launch_description(): - """ - Launch 3 video streamers with cam names `front_cam`, `manip_cam`, `bottom_cam`. - - You'll need `bottom_cam.mp4`, `front_cam.mp4`, & `manip_cam.mp4` in `ros2_video_streamer`. - """ - front_cam_launcher: IncludeLaunchDescription = create_cam_launcher('front') - manip_cam_launcher: IncludeLaunchDescription = create_cam_launcher('manip') - bottom_cam_launcher: IncludeLaunchDescription = create_cam_launcher('bottom') - - return launch.LaunchDescription([ - manip_cam_launcher, - front_cam_launcher, - bottom_cam_launcher - ]) - - -def create_cam_launcher(camera_name: str) -> IncludeLaunchDescription: - return IncludeLaunchDescription( - PythonLaunchDescriptionSource([ - os.path.join( - get_package_share_directory('ros2_video_streamer'), - 'launch', - 'ros2_video_streamer_node_launch.py' - ) - ]), - # Need to set normally camera_name-derived args manually b/c ROS gets - # confused and makes them the same when we launch simultaneously - launch_arguments=[ - ('type', 'video'), - ('camera_name', f'{camera_name}_cam'), - ('image_topic_name', f'/{camera_name}_cam/image_raw'), - ('info_topic_name', f'/{camera_name}_cam/camera_info'), - ('file_name', f'{camera_name}_cam.mp4') - ] - ) diff --git a/src/surface/ros2_video_streamer/package.xml b/src/surface/ros2_video_streamer/package.xml deleted file mode 100644 index cab53ab2..00000000 --- a/src/surface/ros2_video_streamer/package.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - ros2_video_streamer - 0.1.0 - Camera simulator - run a recorded video file streamed on a ros topic as if a live webcamera. - - Benjamin Poulin - Apache License 2.0 - - ament_flake8 - ament_pep257 - python3-pytest - - rclpy - std_msgs - sensor_msgs - vision_opencv - - python3-opencv - - - ament_python - - diff --git a/src/surface/ros2_video_streamer/resource/ros2_video_streamer b/src/surface/ros2_video_streamer/resource/ros2_video_streamer deleted file mode 100644 index e69de29b..00000000 diff --git a/src/surface/ros2_video_streamer/ros2_video_streamer/__init__.py b/src/surface/ros2_video_streamer/ros2_video_streamer/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/surface/ros2_video_streamer/ros2_video_streamer/ros2_video_streamer_node.py b/src/surface/ros2_video_streamer/ros2_video_streamer/ros2_video_streamer_node.py deleted file mode 100644 index b63254c9..00000000 --- a/src/surface/ros2_video_streamer/ros2_video_streamer/ros2_video_streamer_node.py +++ /dev/null @@ -1,167 +0,0 @@ -import os -import cv2 -from cv2 import VideoCapture, Mat -# import yaml -import rclpy - -from rclpy.node import Node -from cv_bridge import CvBridge -from sensor_msgs.msg import Image, CameraInfo -from builtin_interfaces.msg import Time -from ament_index_python.packages import get_package_share_directory - - -class VideoStreamerNode(Node): - """ROS Camera simulator Node; reads video file & pubs ROS Images.""" - - def __init__(self): - super().__init__('ros2_video_streamer_temp_name', - parameter_overrides=[]) - - self.load_launch_parameters() - - # config = self.load_config_file(self.config_file_path) - # if config is not None: - # self.camera_info = self.get_camera_info(config) - # else: - # self.camera_info = None - - self.bridge = CvBridge() - - # Publishers - self.image_publisher_ = self.create_publisher( - Image, - self.image_topic_name, - 5) - self.camera_info_publisher_ = self.create_publisher( - CameraInfo, - self.info_topic_name, - 1) - - if not os.path.isfile(self.path): - raise RuntimeError(f'Invalid video path: {self.path}') - - if self.type == 'video': - self.vc: VideoCapture = cv2.VideoCapture(self.path) - self.vc.set(cv2.CAP_PROP_POS_MSEC, self.start) - video_fps: float = self.vc.get(cv2.CAP_PROP_FPS) - elif self.type == 'image': - self.image = cv2.imread(self.path) - video_fps = 10 - else: - raise ValueError(f'Unknown type: {self.type}') - - self.timer = self.create_timer(1.0/video_fps, self.image_callback) - self.get_logger().info(f'Publishing image at {video_fps} fps') - - def load_launch_parameters(self): - """Load the launch ROS parameters.""" - self.declare_parameter('image_topic_name', - value='/simulated_cam/image_raw') - self.declare_parameter('info_topic_name', - value='/simulated_cam/camera_info') - self.declare_parameter('file_name', value='simulated_cam.mp4') - # self.declare_parameter('config_file_path', value='') - self.declare_parameter('loop', value=True) - self.declare_parameter('frame_id', value='') - self.declare_parameter('type', value='') - self.declare_parameter('start', value=0) - - self.image_topic_name = self.get_parameter('image_topic_name')\ - .get_parameter_value().string_value - self.info_topic_name = self.get_parameter('info_topic_name')\ - .get_parameter_value().string_value - self.file_name = self.get_parameter('file_name')\ - .get_parameter_value().string_value - # self.config_file_path = self.get_parameter('config_file_path')\ - # .get_parameter_value().string_value - self.loop = self.get_parameter('loop')\ - .get_parameter_value().bool_value - self.frame_id_ = self.get_parameter('frame_id')\ - .get_parameter_value().string_value - self.type = self.get_parameter('type')\ - .get_parameter_value().string_value - self.start = self.get_parameter('start')\ - .get_parameter_value().integer_value - - self.path = os.path.join(get_package_share_directory( - 'ros2_video_streamer'), self.file_name) - - # def load_config_file(self, file_path: str): - # """Attempt to load the optional config yaml file.""" - # try: - # path = os.path.join( - # get_package_share_directory('ros2_video_streamer'), - # 'ros2_video_streamer', 'config', file_path) - # f = open(path) - # return yaml.safe_load(f) - # except IOError: - # self.get_logger().warning( - # 'Could not find calibration file ' + file_path + - # ', will proceed without a calibration file') - # return None - - # def get_camera_info(self, config): - # """Extract camera info from the provided config file.""" - # ci = CameraInfo() - # ci.header.frame_id = self.frame_id_ - # ci.width = config['image_width'] - # ci.height = config['image_height'] - # ci.distortion_model = config['distortion_model'] - # ci.d = list(float(v) for v in config['distortion_coefficients']['data']) - # ci.k = list(float(v) for v in config['camera_matrix']['data']) - # ci.r = list(float(v) for v in config['rectification_matrix']['data']) - # ci.p = list(float(v) for v in config['projection_matrix']['data']) - # return ci - - def image_callback(self): - """Process an image or frame of video.""" - if self.type == 'video': - rval, image = self.vc.read() - rval: bool = rval - image: Mat = image - if not rval and not self.loop: - self.get_logger().info('End of video, closing node...') - self.timer.cancel() - self.destroy_node() - exit() - elif not rval and self.loop: - self.vc.set(cv2.CAP_PROP_POS_MSEC, 0) - rval, image = self.vc.read() - elif self.type == 'image': - image = self.image - else: - raise ValueError(f'Unknown type: {self.type}') - - time_msg = self.get_clock().now().to_msg() - img_msg = self.get_image_msg(image, time_msg) - - # if self.camera_info is not None: - # self.camera_info.header.stamp = time_msg - # self.camera_info_publisher_.publish(self.camera_info) - - self.image_publisher_.publish(img_msg) - - def get_image_msg(self, image: Mat, time: Time) -> Image: - """ - Convert cv2 image to ROS2 Image with CvBridge cv2 -> image msg. - - :param image: cv2 image - :return: sensor_msgs/Imag - """ - inverted_image: Mat = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) - img_msg: Image = self.bridge.cv2_to_imgmsg(inverted_image) - img_msg.header.stamp = time - return img_msg - - -def main(): - rclpy.init() - video_streamer_node = VideoStreamerNode() - rclpy.spin(video_streamer_node) - video_streamer_node.destroy_node() - rclpy.shutdown() - - -if __name__ == '__main__': - main() diff --git a/src/surface/ros2_video_streamer/setup.cfg b/src/surface/ros2_video_streamer/setup.cfg deleted file mode 100644 index 445ff69e..00000000 --- a/src/surface/ros2_video_streamer/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[develop] -script-dir=$base/lib/ros2_video_streamer -[install] -install-scripts=$base/lib/ros2_video_streamer \ No newline at end of file diff --git a/src/surface/ros2_video_streamer/setup.py b/src/surface/ros2_video_streamer/setup.py deleted file mode 100644 index a32a38ca..00000000 --- a/src/surface/ros2_video_streamer/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -from setuptools import setup, find_packages -import os -from glob import glob - -PACKAGE_NAME = 'ros2_video_streamer' - -setup( - name=PACKAGE_NAME, - version='0.1.0', - packages=find_packages(), - data_files=[ - ('share/ament_index/resource_index/packages', - ['resource/' + PACKAGE_NAME]), - ('share/' + PACKAGE_NAME, ['package.xml']), - (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*.launch.xml')), - (os.path.join('share', PACKAGE_NAME, 'launch'), - glob('launch/*launch.[pxy][yma]*')), - (os.path.join('share', PACKAGE_NAME, 'config'), glob('config/*.yaml')), - (os.path.join('share', PACKAGE_NAME), glob('*.mp4')) - ], - py_modules=[], - zip_safe=True, - install_requires=[ - 'setuptools', - 'opencv-python' - ], - author='Benjamin Poulin', - maintainer='Benjamin Poulin', - keywords=['ROS2'], - description='Camera simulator - run a recorded video file streamed on a' + - 'ros topic as if a live webcamera.', - license='Apache License, Version 2.0', - tests_require=['pytest'], - entry_points={ - 'console_scripts': [ - 'ros2_video_streamer_node = ros2_video_streamer.ros2_video_streamer_node:main', - ], - }, -) diff --git a/src/surface/ros2_video_streamer/test/test_flake8.py b/src/surface/ros2_video_streamer/test/test_flake8.py deleted file mode 100644 index 27ee1078..00000000 --- a/src/surface/ros2_video_streamer/test/test_flake8.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_flake8.main import main_with_errors -import pytest - - -@pytest.mark.flake8 -@pytest.mark.linter -def test_flake8(): - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ - '\n'.join(errors) diff --git a/src/surface/ros2_video_streamer/test/test_pep257.py b/src/surface/ros2_video_streamer/test/test_pep257.py deleted file mode 100644 index b234a384..00000000 --- a/src/surface/ros2_video_streamer/test/test_pep257.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2015 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_pep257.main import main -import pytest - - -@pytest.mark.linter -@pytest.mark.pep257 -def test_pep257(): - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' From b06bbb84444692a20e114b4ec6f2c121813c155a Mon Sep 17 00:00:00 2001 From: Robert Carlstrom Date: Sun, 2 Jul 2023 16:56:44 -0400 Subject: [PATCH 02/12] added back manipulators --- src/pi/manipulators/launch/manip_launch.py | 20 ++++++ src/pi/manipulators/manipulators/__init__.py | 0 .../manipulators/manipulators/manip_tester.py | 37 +++++++++++ .../manipulators/manipulators/manipulators.py | 63 +++++++++++++++++++ src/pi/manipulators/package.xml | 18 ++++++ src/pi/manipulators/resource/manipulators | 0 src/pi/manipulators/setup.cfg | 4 ++ src/pi/manipulators/setup.py | 39 ++++++++++++ src/pi/manipulators/test/test_flake8.py | 25 ++++++++ src/pi/manipulators/test/test_pep257.py | 23 +++++++ 10 files changed, 229 insertions(+) create mode 100644 src/pi/manipulators/launch/manip_launch.py create mode 100644 src/pi/manipulators/manipulators/__init__.py create mode 100644 src/pi/manipulators/manipulators/manip_tester.py create mode 100644 src/pi/manipulators/manipulators/manipulators.py create mode 100644 src/pi/manipulators/package.xml create mode 100644 src/pi/manipulators/resource/manipulators create mode 100644 src/pi/manipulators/setup.cfg create mode 100644 src/pi/manipulators/setup.py create mode 100644 src/pi/manipulators/test/test_flake8.py create mode 100644 src/pi/manipulators/test/test_pep257.py diff --git a/src/pi/manipulators/launch/manip_launch.py b/src/pi/manipulators/launch/manip_launch.py new file mode 100644 index 00000000..b1196ce5 --- /dev/null +++ b/src/pi/manipulators/launch/manip_launch.py @@ -0,0 +1,20 @@ +from launch import LaunchDescription +from launch_ros.actions import Node + + +def generate_launch_description(): + + manip_node = Node( + package="manipulators", + executable="manipulator", + parameters=[ + {"claw0": 0}, + {"claw1": 1}, + {"light": 2}, + ], + remappings=[("/pi/manipulator_control", "/manipulator_control")] + ) + + return LaunchDescription([ + manip_node + ]) diff --git a/src/pi/manipulators/manipulators/__init__.py b/src/pi/manipulators/manipulators/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/pi/manipulators/manipulators/manip_tester.py b/src/pi/manipulators/manipulators/manip_tester.py new file mode 100644 index 00000000..d655f018 --- /dev/null +++ b/src/pi/manipulators/manipulators/manip_tester.py @@ -0,0 +1,37 @@ + +""" +Need to run this command. + +sudo chmod a+rw /dev/i2c-* +link to permanant solution +this solution worked +https://unix.stackexchange.com/questions/147494/how-can-i-set-device-rw-permissions-permanently-on-raspbian +""" + +from manipulators.tca9555 import TCA9555 +import time + + +def main(): + # Initialize with standard I2C-bus address of TCA9555 a.k.a 0x20 + gpio = TCA9555() # can put in the address as a param in hexadecimal + + # # Print :startup-config as human-readable + print(gpio.format_config()) + + # # Set pins 0 through 5 as output + gpio.set_direction(0, bits=(0, 1, 2, 3, 4, 5)) + print(gpio.format_config()) + + # Turn on the LEDs + gpio.set_bits(bits=(0, 1, 2, 3, 4, 5)) + print(gpio.format_config()) + time.sleep(5) + + # # Turn off the LEDs + gpio.unset_bits(bits=(0, 1, 2, 3, 4, 5)) + print(gpio.format_config()) + + +if __name__ == "__main__": + main() diff --git a/src/pi/manipulators/manipulators/manipulators.py b/src/pi/manipulators/manipulators/manipulators.py new file mode 100644 index 00000000..f86827ee --- /dev/null +++ b/src/pi/manipulators/manipulators/manipulators.py @@ -0,0 +1,63 @@ +import rclpy +from rclpy.node import Node, Subscription +from interfaces.msg import Manip +from manipulators.tca9555 import TCA9555 + + +class Manipulator(Node): + + def __init__(self): + super().__init__('manipulator', + parameter_overrides=[]) + + self.subscription: Subscription = self.create_subscription( + Manip, + 'manipulator_control', + self.manip_callback, + 100 + ) + + self.declare_parameters( + namespace="", + parameters=[ + ("claw0", rclpy.Parameter.Type.INTEGER), + ("claw1", rclpy.Parameter.Type.INTEGER), + ("light", rclpy.Parameter.Type.INTEGER), + ]) + + # Initialize with standard I2C-bus address of TCA9555 a.k.a 0x20 + self.gpio = TCA9555() # can put in the address as a param in hexadecimal + self.get_logger().info(str(self.gpio.format_config())) + + # Set pins 0 through 5 as output + self.gpio.set_direction(0, bits=(0, 1, 2, 3, 4, 5)) + self.gpio.unset_bits(bits=(0, 1, 2, 3, 4, 5)) + + def manip_callback(self, request: Manip): + manip_id = request.manip_id + activated = request.activated + + pin = self._parameters[manip_id].get_parameter_value().integer_value + + if activated: + self.gpio.set_bits(bits=(pin)) + else: + self.gpio.unset_bits(bits=(pin)) + + +def main(): + rclpy.init() + + subscriber = Manipulator() + + rclpy.spin(subscriber) + + # Destroy the node explicitly + # (optional - otherwise it will be done automatically + # when the garbage collector destroys the node object) + subscriber.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() diff --git a/src/pi/manipulators/package.xml b/src/pi/manipulators/package.xml new file mode 100644 index 00000000..6fb3f780 --- /dev/null +++ b/src/pi/manipulators/package.xml @@ -0,0 +1,18 @@ + + + + manipulators + 0.0.0 + Code for manipulators. + Michael Carlstrom + Apache License, Version 2.0 + + ament_copyright + ament_flake8 + ament_pep257 + python3-pytest + python-bitstring-pip + + ament_python + + diff --git a/src/pi/manipulators/resource/manipulators b/src/pi/manipulators/resource/manipulators new file mode 100644 index 00000000..e69de29b diff --git a/src/pi/manipulators/setup.cfg b/src/pi/manipulators/setup.cfg new file mode 100644 index 00000000..80e19e18 --- /dev/null +++ b/src/pi/manipulators/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script_dir=$base/lib/manipulators +[install] +install_scripts=$base/lib/manipulators diff --git a/src/pi/manipulators/setup.py b/src/pi/manipulators/setup.py new file mode 100644 index 00000000..5c6cf587 --- /dev/null +++ b/src/pi/manipulators/setup.py @@ -0,0 +1,39 @@ +import os +from glob import glob +from setuptools import setup +import sys + + +major_num = sys.version_info[0] +minor_num = sys.version_info[1] + +package_name = 'manipulators' + +setup( + name=package_name, + version='0.0.0', + packages=[package_name], + data_files=[ + ('share/ament_index/resource_index/packages', + ['resource/' + package_name]), + ('share/' + package_name, ['package.xml']), + # Include all launch files. + (os.path.join('share', package_name, 'launch'), + glob('launch/*launch.[pxy][yma]*')), + (os.path.join('lib', f'python{major_num}.{minor_num}', 'site-packages', package_name), + glob(os.path.join('TCA9555', 'tca9555', 'tca9555.py'))), + ], + install_requires=['setuptools', 'bitstring', 'wiringpi'], + zip_safe=True, + maintainer='taz', + maintainer_email='tzupfer@gmail.com', + description='Code for manipulators', + license='Apache 2.0', + tests_require=['pytest'], + entry_points={ + 'console_scripts': [ + 'manipulator = manipulators.manipulators:main', + 'test = manipulators.manip_tester:main' + ], + }, +) diff --git a/src/pi/manipulators/test/test_flake8.py b/src/pi/manipulators/test/test_flake8.py new file mode 100644 index 00000000..27ee1078 --- /dev/null +++ b/src/pi/manipulators/test/test_flake8.py @@ -0,0 +1,25 @@ +# Copyright 2017 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_flake8.main import main_with_errors +import pytest + + +@pytest.mark.flake8 +@pytest.mark.linter +def test_flake8(): + rc, errors = main_with_errors(argv=[]) + assert rc == 0, \ + 'Found %d code style errors / warnings:\n' % len(errors) + \ + '\n'.join(errors) diff --git a/src/pi/manipulators/test/test_pep257.py b/src/pi/manipulators/test/test_pep257.py new file mode 100644 index 00000000..b234a384 --- /dev/null +++ b/src/pi/manipulators/test/test_pep257.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_pep257.main import main +import pytest + + +@pytest.mark.linter +@pytest.mark.pep257 +def test_pep257(): + rc = main(argv=['.', 'test']) + assert rc == 0, 'Found code style errors / warnings' From cb6f93903a8cb630f90ae42f4ca556d16b9e8fd3 Mon Sep 17 00:00:00 2001 From: Robert Carlstrom Date: Sun, 2 Jul 2023 16:59:50 -0400 Subject: [PATCH 03/12] updated float file names --- src/float/{Tranciever_Transmitter_WithUTC.ino => float.ino} | 0 src/float/{Tranciever_Reciever.ino => surface.ino} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/float/{Tranciever_Transmitter_WithUTC.ino => float.ino} (100%) rename src/float/{Tranciever_Reciever.ino => surface.ino} (100%) diff --git a/src/float/Tranciever_Transmitter_WithUTC.ino b/src/float/float.ino similarity index 100% rename from src/float/Tranciever_Transmitter_WithUTC.ino rename to src/float/float.ino diff --git a/src/float/Tranciever_Reciever.ino b/src/float/surface.ino similarity index 100% rename from src/float/Tranciever_Reciever.ino rename to src/float/surface.ino From 48f613041fbffebd2a9276b5d97d78849d41e17e Mon Sep 17 00:00:00 2001 From: Robert Carlstrom Date: Sun, 2 Jul 2023 17:09:13 -0400 Subject: [PATCH 04/12] fixed submodule --- src/pi/manipulators/TCA9555 | 1 + src/surface/ros2_video_streamer | 1 + src/surface/rov_gazebo/README.md | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 160000 src/pi/manipulators/TCA9555 create mode 160000 src/surface/ros2_video_streamer diff --git a/src/pi/manipulators/TCA9555 b/src/pi/manipulators/TCA9555 new file mode 160000 index 00000000..bd1b9c21 --- /dev/null +++ b/src/pi/manipulators/TCA9555 @@ -0,0 +1 @@ +Subproject commit bd1b9c21a4baff5af10e0cd67b9889822a7c8709 diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer new file mode 160000 index 00000000..17d56c5e --- /dev/null +++ b/src/surface/ros2_video_streamer @@ -0,0 +1 @@ +Subproject commit 17d56c5e8716b83e830b4a91ef943a4b4ef1cea1 diff --git a/src/surface/rov_gazebo/README.md b/src/surface/rov_gazebo/README.md index 0e8c8776..6e13366a 100644 --- a/src/surface/rov_gazebo/README.md +++ b/src/surface/rov_gazebo/README.md @@ -3,7 +3,7 @@ ## 1. Build ```bash -cd ~/rov_24 +cd ~/rov-24 colcon build ``` From a39cdc66711d5437a27435a00a25d63a3176190d Mon Sep 17 00:00:00 2001 From: Robert Carlstrom Date: Sun, 2 Jul 2023 17:20:00 -0400 Subject: [PATCH 05/12] fixed camera_launch file linter --- src/pi/camera_streamer/launch/camera_launch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pi/camera_streamer/launch/camera_launch.py b/src/pi/camera_streamer/launch/camera_launch.py index 227d716d..74b07428 100644 --- a/src/pi/camera_streamer/launch/camera_launch.py +++ b/src/pi/camera_streamer/launch/camera_launch.py @@ -46,7 +46,7 @@ def generate_launch_description(): ) return LaunchDescription([ - # front_cam_node, - # bottom_cam_node + front_cam_node, + bottom_cam_node, camera_switch_node ]) From 0a6e9585e937c1b845c461dfa229b185e6e09b94 Mon Sep 17 00:00:00 2001 From: Robert Carlstrom Date: Sun, 2 Jul 2023 17:26:07 -0400 Subject: [PATCH 06/12] updated github action base on github action linter --- .github/workflows/industrial_ci_action.yml | 50 +++++++++++++++++----- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 02311180..e0f483d8 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -1,16 +1,46 @@ -# https://github.com/ros-industrial/industrial_ci/blob/master/README.rst#id7 -name: Continuous Integration +# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). +# For troubleshooting, see README (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) -on: push +name: Continous Integration + +on: # this determines when this workflow is run + push: + # branches: [ master, melodic-devel ] # when master or melodic-devel branch is pushed to + pull_request: + # branches: [ master ] # when there is a pull request against master + # schedule: # uncomment to run periodically + # - cron: '0 4 * * *' # every day at 4 AM (UTC) + workflow_dispatch: # allow manually starting this workflow jobs: industrial_ci: - strategy: - matrix: - env: - - {ROS_DISTRO: galactic, ROS_REPO: main} + name: ROS ${{ matrix.ROS_DISTRO }} (${{ matrix.ROS_REPO }}) runs-on: ubuntu-latest + strategy: + # fail-fast: false # uncomment if failing jobs should not cancel the others immediately + matrix: # matrix is the product of entries + ROS_DISTRO: [humble] + ROS_REPO: [main] + # exclude: # specific configuration can be excludes + # - {ROS_DISTRO: melodic, ROS_REPO: testing} + # include: # add additional configurations + # - {ROS_DISTRO: kinetic, ROS_REPO: testing} + env: + CCACHE_DIR: "${{ github.workspace }}/.ccache" # directory for ccache (and how we enable ccache in industrial_ci) steps: - - uses: actions/checkout@v3 - - uses: 'ros-industrial/industrial_ci@master' - env: ${{matrix.env}} + - uses: actions/checkout@v3 # clone target repository + - uses: actions/cache@v2 # fetch/store the directory used by ccache before/after the ci run + with: + path: ${{ env.CCACHE_DIR }} + # This configuration will always create a new ccache cache starting off from the previous one (if any). + # In this simple version it will be shared between all builds of the same ROS_REPO and ROS_REPO + # and might need some fine-tuning to match the use case + key: ccache-${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}-${{github.run_id}} + restore-keys: | + ccache-${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}- + - uses: 'ros-industrial/industrial_ci@master' # run industrial_ci + env: # either pass all entries explicitly + ROS_DISTRO: ${{ matrix.ROS_DISTRO }} + ROS_REPO: ${{ matrix.ROS_REPO }} + # with: # or pass the full matrix as config + # config: ${{toJSON(matrix)}} \ No newline at end of file From a300c745b41a52ebcba2b86f5a38d7b108b1da7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 07:06:17 +0000 Subject: [PATCH 07/12] Bump actions/cache from 2 to 3 in /.github/workflows Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/industrial_ci_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index e0f483d8..6aa16502 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -29,7 +29,7 @@ jobs: CCACHE_DIR: "${{ github.workspace }}/.ccache" # directory for ccache (and how we enable ccache in industrial_ci) steps: - uses: actions/checkout@v3 # clone target repository - - uses: actions/cache@v2 # fetch/store the directory used by ccache before/after the ci run + - uses: actions/cache@v3 # fetch/store the directory used by ccache before/after the ci run with: path: ${{ env.CCACHE_DIR }} # This configuration will always create a new ccache cache starting off from the previous one (if any). From 036ab1e2f8099156336118b42bc31659bb339f1c Mon Sep 17 00:00:00 2001 From: Michael Carlstrom <36806982+InvincibleRMC@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:34:06 -0400 Subject: [PATCH 08/12] Update README.md --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index 9ed1bbf6..110a2009 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,6 @@ If you don't have `ros2_video_streamer` in the new `src` folder, run this: git submodule update --init --recursive ``` -### Building for VSCode users - -Copy `src/.vscode/tasks.json` to `.vscode/tasks.json`: - -```bash -cp src/.vscode/tasks.json .vscode -``` - Now, anytime you want to build, do the following: In VSCode, press `F1` and enter `Tasks: Run Task` in the field until you see the From a739ef7fbd4bae8eb8dc9054ebbb8e232b46e9e0 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom <36806982+InvincibleRMC@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:36:41 -0400 Subject: [PATCH 09/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 110a2009..53857b62 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ interfaces, you'll need to run this every time you change something: Make sure you're updated (only on the first build or if something breaks) ```bash -rosdep update --rosdistro=$ROS_DISTRO --include-eol-distros +rosdep update --rosdistro=$ROS_DISTRO ``` Install dependecies (only on the first build or if something breaks) From a2df35b4c81ac8d90c37c17c75a9f0d7562f9013 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 3 Jul 2023 15:44:04 -0400 Subject: [PATCH 10/12] made install executable --- src/surface/surface_main/scripts/ROS2-Install-Galactic.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/surface/surface_main/scripts/ROS2-Install-Galactic.sh diff --git a/src/surface/surface_main/scripts/ROS2-Install-Galactic.sh b/src/surface/surface_main/scripts/ROS2-Install-Galactic.sh old mode 100644 new mode 100755 From a05dcd71dcab7e8245b587a1f067ff3c09c72107 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom <36806982+InvincibleRMC@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:54:40 -0400 Subject: [PATCH 11/12] Update industrial_ci_action.yml --- .github/workflows/industrial_ci_action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 6aa16502..4632d49b 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -6,7 +6,7 @@ name: Continous Integration on: # this determines when this workflow is run push: # branches: [ master, melodic-devel ] # when master or melodic-devel branch is pushed to - pull_request: + # pull_request: # branches: [ master ] # when there is a pull request against master # schedule: # uncomment to run periodically # - cron: '0 4 * * *' # every day at 4 AM (UTC) @@ -43,4 +43,4 @@ jobs: ROS_DISTRO: ${{ matrix.ROS_DISTRO }} ROS_REPO: ${{ matrix.ROS_REPO }} # with: # or pass the full matrix as config - # config: ${{toJSON(matrix)}} \ No newline at end of file + # config: ${{toJSON(matrix)}} From a645c4bda1d481f5be9e824e8997c8ae10f9ba38 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 3 Jul 2023 15:56:41 -0400 Subject: [PATCH 12/12] made more .sh files executables --- .vscode/easy_all.sh | 0 .vscode/easy_build.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .vscode/easy_all.sh mode change 100644 => 100755 .vscode/easy_build.sh diff --git a/.vscode/easy_all.sh b/.vscode/easy_all.sh old mode 100644 new mode 100755 diff --git a/.vscode/easy_build.sh b/.vscode/easy_build.sh old mode 100644 new mode 100755