File tree Expand file tree Collapse file tree 4 files changed +8
-16
lines changed Expand file tree Collapse file tree 4 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- # System imports
1615import base64
1716import random
1817
19- # OpenCV
2018import cv2
2119
22- # Numpy
2320import numpy
2421
2522# THE FOLLOWING IS A BURGER IN BASE64. RESPECT IT
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- # System imports
1615import argparse
1716import sys
1817
19- # Local imports
2018import burger_py
2119
22- # OpenCV imports
2320import cv2
2421
25- # ROS2 imports
2622import rclpy
2723from rclpy .qos import qos_profile_system_default , qos_profile_sensor_data
2824import sensor_msgs .msg
2925import std_msgs .msg
3026
3127
32- # Convert an OpenCV matrix encoding type to a string format recognized by
33- # sensor_msgs::Image
3428def mat2encoding (frame ):
29+ '''
30+ Convert an OpenCV matrix encoding type to a string format recognized by
31+ sensor_msgs::msg::Image
32+ '''
3533 encoding = ''
3634
3735 encodings = {1 : 'mono' , 3 : 'bgr' , 4 : 'rgba' }
@@ -53,8 +51,10 @@ def mat2encoding(frame):
5351 return encoding
5452
5553
56- # Convert an OpenCV matrix to a ROS Image message.
5754def convert_frame_to_message (frame , frame_id , msg ):
55+ '''
56+ Convert an OpenCV matrix to a ROS Image message.
57+ '''
5858 msg .height = frame .shape [0 ]
5959 msg .width = frame .shape [1 ]
6060 msg .encoding = mat2encoding (frame )
@@ -165,7 +165,6 @@ def flip_image_cb(msg):
165165 frame_number = 1
166166 while rclpy .ok ():
167167 # Get the frame from the video capture.
168- frame = None
169168 if args .burger_mode :
170169 frame = burger_cap .render_burger (args .width , args .height )
171170 else :
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def run(self):
4747
4848setup (
4949 name = package_name ,
50- version = '0.0 .0' ,
50+ version = '0.1 .0' ,
5151 packages = [],
5252 py_modules = [
5353 'burger_py' ,
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- # System imports
1615import argparse
1716
18- # OpenCV imports
1917import cv2
2018
21- # Numpy imports
2219import numpy
2320
24- # ROS2 imports
2521import rclpy
2622from rclpy .qos import qos_profile_system_default
2723import sensor_msgs .msg
You can’t perform that action at this time.
0 commit comments