-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from rogy-AquaLab/imshow_python2
imshowパッケージをpythonに再変更
- Loading branch information
Showing
10 changed files
with
63 additions
and
94 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import rclpy | ||
from rclpy.node import Node | ||
from sensor_msgs.msg import Image | ||
from cv_bridge import CvBridge | ||
import cv2 | ||
|
||
|
||
class Imshow(Node): | ||
def __init__(self): | ||
super().__init__('imshow') | ||
self.subscription=self.create_subscription(Image, 'camera_image', self.listener_callback, 10) | ||
self.bridge=CvBridge() | ||
|
||
def listener_callback(self, msg): | ||
frame=self.bridge.imgmsg_to_cv2(msg, "bgr8") | ||
cv2.imshow('Camera', frame) | ||
cv2.waitKey(1) | ||
|
||
def main(args=None): | ||
rclpy.init(args=args) | ||
imshow=Imshow() | ||
rclpy.spin(imshow) | ||
imshow.destroy_node() | ||
rclpy.shutdown() | ||
|
||
if __name__=='__main__': | ||
main() |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,13 @@ | |
<name>imshow</name> | ||
<version>0.0.0</version> | ||
<description>ROS 2 package for receiving images</description> | ||
<maintainer email="[email protected]">hiro</maintainer> | ||
<maintainer email="[email protected]">hiro</maintainer> | ||
<license>MIT License</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<build_depend>rclcpp</build_depend> | ||
<build_depend>sensor_msgs</build_depend> | ||
<build_depend>cv_bridge</build_depend> | ||
<build_depend>image_transport</build_depend> | ||
<exec_depend>rclcpp</exec_depend> | ||
<exec_depend>rclpy</exec_depend> | ||
<exec_depend>sensor_msgs</exec_depend> | ||
<exec_depend>cv_bridge</exec_depend> | ||
<exec_depend>image_transport</exec_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
<build_type>ament_python</build_type> | ||
</export> | ||
</package> |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[develop] | ||
script_dir=$base/lib/imshow | ||
[install] | ||
install_scripts=$base/lib/imshow |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
from glob import glob | ||
|
||
from setuptools import find_packages, setup | ||
|
||
package_name = 'imshow' | ||
|
||
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']), | ||
(os.path.join('share',package_name,'launch'),glob(os.path.join('launch','*'))) | ||
], | ||
install_requires=['setuptools'], | ||
zip_safe=True, | ||
maintainer='hiro', | ||
maintainer_email='[email protected]', | ||
description='Image display for ROS2', | ||
license='MIT License', | ||
tests_require=[], | ||
entry_points={ | ||
'console_scripts': [ | ||
'imshow = imshow.imshow:main', | ||
], | ||
}, | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.