This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initial code from https://github.com/ros-perception/vision_opencv/blob/noetic/cv_bridge/python/cv_bridge/core.py | |
import cv2 | |
import numpy as np | |
import sensor_msgs | |
def cv2_to_imgmsg(cvim, encoding="passthrough", header=None): | |
if not isinstance(cvim, (np.ndarray, np.generic)): | |
raise TypeError('Your input type is not a numpy array') | |
# prepare msg | |
img_msg = sensor_msgs.msg.Image() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flutter-watch(){ | |
local PID_FILE="/tmp/tf$$.pid" | |
tmux new-session \;\ | |
send-keys "flutter run --pid-file=$PID_FILE" Enter \;\ | |
split-window -v \;\ | |
send-keys "npx -y nodemon -e dart -x \"cat $PID_FILE | xargs kill -s USR1\"" Enter \;\ | |
resize-pane -y 5 -t 1 \;\ | |
select-pane -t 0 \; | |
rm $PID_FILE; | |
} |