BYU-AUVSI / a6000_ros

Interact with a Sony a6000 through ROS using gphoto2 library
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

TODO #1

Open len0rd opened 5 years ago

len0rd commented 5 years ago

Details On point 3: During the competition itself, we had someone ssh'ed into the plane who would turn the camera driver on/off whenever the plane started flying in the search path. This helps limit the number of images received with no targets, and thus helps reduce potential false positives identified by the autonomous imaging system. This also helps conserve bandwidth when the plane is flying long-distance waypoints. Note the imaging search path is fairly close to the flight line, which means network connection during imaging is pretty good.

LauraYan commented 2 years ago

Hi, is this head file #include <uav_msgs/CompressedImgWithMeta.h> ROS hector_quadrotor package?

Sorry, I encountered one issue that this file( uav_msgs/CompressedImgWithMeta.h) can't be find out, and ROS version I am using is Melodic.

Also, did you use Kinetic version in this code?

Thank you for your replay in advance.

len0rd commented 2 years ago

Hi @LauraYan

Per the readme, uav_msgs/CompressedImgWithMeta lives in the BYU-AUVSI/uav_msgs repo. Adding that repo to your catkin_ws should resolve the include issue.

Also per the TODO in that section of the readme, I think we could move to using the standard ROS CompressedImage.msg type. All the information transported in CompressedImgWithMeta should be available in the JPEG EXIF data which could be decoded by a user as needed. Feel free to tackle that if your want to improve the repo :)

I think this was developed on Kinetic, but I believe Melodic would work with little to no changes. Havent touched ROS since Melodic so I cant speak to future versions.

Hopefully this helps! Been a while since I touched this code

LauraYan commented 2 years ago

😄Thank you so much to feed back me so swiftly. Thank you for your information. I will research it. I also reported a new issue.

Thank you again. Happy holidays and new year.

Sincerely,

On Fri, Dec 24, 2021 at 10:09 len0rd @.***> wrote:

Hi @LauraYan https://github.com/LauraYan

Per the readme, uav_msgs/CompressedImgWithMeta lives in the BYU-AUVSI/uav_msgs https://github.com/BYU-AUVSI/uav_msgs/tree/master/msg repo. Adding that repo to your catkin_ws should resolve the include issue.

Also per the TODO in that section of the readme, I think we could move to using the standard ROS CompressedImage.msg type. All the information transported in CompressedImgWithMeta should be available in the JPEG EXIF data which could be decoded by a user as needed. Feel free to tackle that if your want to improve the repo :)

I think this was developed on Kinetic, but I believe Melodic would work with little to no changes. Havent touched ROS since Melodic so I cant speak to future versions.

Hopefully this helps! Been a while since I touched this code

— Reply to this email directly, view it on GitHub https://github.com/BYU-AUVSI/a6000_ros/issues/1#issuecomment-1000901529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGNQKKBXZBWQGILD2LP5ICLUSSSKXANCNFSM4GKTYHWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

LauraYan commented 2 years ago

Thank you so much. I solved the problem as your guide. Have a nice day On Fri, Dec 24, 2021 at 10:29 Laura @.***> wrote:

😄Thank you so much to feed back me so swiftly. Thank you for your information. I will research it. I also reported a new issue.

Thank you again. Happy holidays and new year.

Sincerely,

On Fri, Dec 24, 2021 at 10:09 len0rd @.***> wrote:

Hi @LauraYan https://github.com/LauraYan

Per the readme, uav_msgs/CompressedImgWithMeta lives in the BYU-AUVSI/uav_msgs https://github.com/BYU-AUVSI/uav_msgs/tree/master/msg repo. Adding that repo to your catkin_ws should resolve the include issue.

Also per the TODO in that section of the readme, I think we could move to using the standard ROS CompressedImage.msg type. All the information transported in CompressedImgWithMeta should be available in the JPEG EXIF data which could be decoded by a user as needed. Feel free to tackle that if your want to improve the repo :)

I think this was developed on Kinetic, but I believe Melodic would work with little to no changes. Havent touched ROS since Melodic so I cant speak to future versions.

Hopefully this helps! Been a while since I touched this code

— Reply to this email directly, view it on GitHub https://github.com/BYU-AUVSI/a6000_ros/issues/1#issuecomment-1000901529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGNQKKBXZBWQGILD2LP5ICLUSSSKXANCNFSM4GKTYHWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

LauraYan commented 2 years ago

Hi len0rd, I feel the images captured by 6000 camera by your code have been save into files, so they are not in camera sd card, right?

I ran the a6000_ros_node, it worked --------------------------------------- there are information I got--------------------------------------------- rosrun a6000_ros a6000_ros_node Startup Camera Connector Startup Camera Connector Detected 1 camera! Connecting to camera 1 PORT INFO:: type: 4 name: Universal Serial Bus path: usb:001,029

Camera info: Manufacturer: Sony Corporation Model: ILCE-6000 Version: 3.0 Serial Number: 00000000000000003282681006858933 Vendor Extension ID: 0x11 (1.0) Vendor Extension Description: Sony PTP Extensions

Capture Formats: Display Formats: JPEG, Unknown(b301), ARW

Device Capabilities: File Download, No File Deletion, No File Upload No Image Capture, No Open Capture, Sony Capture

Connection Successful! camera getfile of capt0000.jpg camera getfile of capt0001.jpg camera getfile of capt0002.jpg camera getfile of capt0003.jpg camera getfile of capt0004.jpg camera getfile of capt0005.jpg ^C camera getfile of capt0006.jpg --------------------------------------------------informaiton End--------------------------------------------------

However, i can't find them on camera memory card, no find them in Linux by "find -name "capt0" in the root directory. I wonder how can I get these images. Thank you.

len0rd commented 2 years ago

Yep, thats an intentional feature of the code. Otherwise its possible it could fill the SD card and all subsequent captures would fail (if I'm remembering correctly). Once captured, the image is immediately downloaded into host memory then deleted off the sdcard. The a6000_ros_node publishes the images in a topic with the custom CompressedImgWithMeta type. Googling how to view ROS image topic data should help you solve how to view that topic.

In the driver code you can find places where gp_camera_file_delete is called which I believe is the call that deletes the file off the sdcard after it has been successfully downloaded onto the host machine. I'm guessing if you comment those out the file will remain on the sdcard

The camera connector class also has a CameraConnector::writeImageToFile method which you could insert into the GphotoCameraROS::run loop to have every image saved on your host machine.

There's also a test application (in src/test/main.cpp) that you could modify. The test application does not use ROS at all. It simply connects to the camera, saves 10 photos onto the host machine, then exits

LauraYan commented 2 years ago

Yes, lenOrd, I have to write a code similar to CameraConnector::writeImageToFile() or call glibphoto2 function gp_file_save() to save images into disks. Thank you for your reply.

LauraYan commented 2 years ago

Hey lenOrd, I meet one more question, how can you compile this file with this type "#include <uav_msgs/CompressedImgWithMeta.h> " in the /include/camera_node_ros.h file. I have to write it in"/home/myusername/catkin_ws/.../../../uav_msgs/CompressedImgWithMeta.h", it can compile without mistakes. Could you tell me where you put uav_msgs project, so you can compile without absolute directory? Thank you in advance.

len0rd commented 2 years ago

Hi @LauraYan

Apologies for the late reply. Hopefully you figured this out already, but you should put the uav_msgs in your catkin_ws/src directory so it’s part of your catkin build.

Hopefully that works. As I’ve said in other comments it might be possible to remove that dependency entirely, especially if you don’t care about orientation data.