-
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.
Co-authored-by: Thomas Neill <[email protected]>
- Loading branch information
1 parent
20bdeb8
commit fedd355
Showing
31 changed files
with
188 additions
and
62 deletions.
There are no files selected for viewing
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
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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
<launch> | ||
<node pkg="libuavf_2024" exec="imaging_node.py" name="imaging_server" /> | ||
<node pkg="libuavf_2024" exec="demo_imaging_node.py" name="imaging_client" /> | ||
</launch> |
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>uavf_2024</name> | ||
<name>libuavf_2024</name> | ||
<version>0.0.0</version> | ||
<description>TODO: Package description</description> | ||
<maintainer email="[email protected]">Herpderk</maintainer> | ||
|
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,38 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import rclpy | ||
from rclpy.node import Node | ||
from uavf_2024.imaging import Camera | ||
from time import sleep | ||
|
||
class CameraTestNode(Node): | ||
def __init__(self) -> None: | ||
super().__init__('imaging_node') | ||
self.camera = Camera() | ||
self.camera.setAbsoluteZoom(1) | ||
self.camera.cam.requestAbsolutePosition(0, 0) | ||
sleep(2) | ||
|
||
def loop(self): | ||
while True: | ||
print(self.camera.cam.getAttitude()) | ||
sleep(1/10) | ||
# if self.camera.cam.requestGimbalAttitude(): | ||
# attitude = self.camera.cam.getAttitude() | ||
# self.get_logger().info(str(attitude)) | ||
# else: | ||
# self.get_logger().info(":(") | ||
# sleep(1) | ||
|
||
|
||
def main(args=None) -> None: | ||
print('Starting imaging node...') | ||
rclpy.init(args=args) | ||
node = CameraTestNode() | ||
node.loop() | ||
|
||
if __name__ == '__main__': | ||
try: | ||
main() | ||
except Exception as e: | ||
print(e) |
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
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
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,36 @@ | ||
#!/usr/bin/env python3 | ||
from libuavf_2024.srv import TakePicture | ||
import rclpy | ||
from rclpy.node import Node | ||
from time import sleep | ||
|
||
class DemoImagingClient(Node): | ||
|
||
def __init__(self): | ||
super().__init__('demo_imaging_client') | ||
self.get_logger().info("Initializing Client") | ||
self.cli = self.create_client(TakePicture, 'imaging_service') | ||
while not self.cli.wait_for_service(timeout_sec=1.0): | ||
self.get_logger().info('service not available, waiting again...') | ||
self.get_logger().info("Finished intializing client") | ||
self.req = TakePicture.Request() | ||
sleep(5) | ||
res = self.send_request() | ||
self.get_logger().info(str(res.detections)) | ||
|
||
def send_request(self): | ||
self.get_logger().info("Sending request") | ||
self.future = self.cli.call_async(self.req) | ||
rclpy.spin_until_future_complete(self, self.future) | ||
res = self.future.result() | ||
return res | ||
|
||
# Command to run: ros2 run uavf_2024 demo_imaging_node.py | ||
|
||
if __name__ == '__main__': | ||
print('Starting client node...') | ||
rclpy.init() | ||
node = DemoImagingClient() | ||
rclpy.spin(node) | ||
node.destroy_node() | ||
rclpy.shutdown() |
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
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
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
uavf_2024/TargetDetection[] detections | ||
libuavf_2024/TargetDetection[] detections |
Empty file.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
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
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
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
import line_profiler | ||
profiler = line_profiler.LineProfiler() | ||
profiler = line_profiler.LineProfiler() | ||
|
||
from .image_processor import ImageProcessor | ||
from .localizer import Localizer | ||
from .camera import Camera |
Oops, something went wrong.