Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture images from spot cam in a convenient way #139

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
16188d5
service for capturing images from the spot cam to a directory
heuristicus Jun 14, 2023
ae2e985
fix empty file extension, can specify preferred extension in base fil…
heuristicus Jun 15, 2023
a08129d
fix capture_count overriding capture_duration, capture is now an acti…
heuristicus Jun 15, 2023
5464c8b
publish current cam screen, capture checks current screen and waits a…
heuristicus Jun 15, 2023
88ed522
use latched publisher for current screen and only update if changed
heuristicus Jun 15, 2023
bfcdb9f
minimum image width for spot cam is zero so it can be ignored
heuristicus Jun 23, 2023
d2e4ee8
publish a marker at the location of the looked at point with cam
heuristicus Jun 23, 2023
60d6762
empty screen in cam capture image captures current screen
heuristicus Jun 27, 2023
291a7f8
don't use rgb8 on image conversion, this should improve image quality
heuristicus Jul 2, 2023
082d0f2
add actionserver for high quality image capture using the cam medialog
heuristicus Jul 2, 2023
d09e06c
add high quality image action to cmakelists
heuristicus Jul 5, 2023
b91de4d
fix duplicated actionserver names
heuristicus Jul 5, 2023
a01189d
fix set succeeded message type
heuristicus Jul 5, 2023
4713cf5
return after saving logpoint if it is just a single one
heuristicus Jul 5, 2023
2874917
correct return from capture image high quality
heuristicus Jul 5, 2023
a4b614a
when saving one image message contains the filename, and fails if no …
heuristicus Jul 5, 2023
913774e
frequency in capture image should be float
heuristicus Jul 5, 2023
6b81cab
catch capture frequency leq 0 and set to 1
heuristicus Jul 5, 2023
1db5f3c
exit camera capture loop when time elapsed is strictly larger than th…
heuristicus Jul 5, 2023
55f9f66
fix use of last trajectory command
heuristicus Jul 6, 2023
1bdeac6
look at point can now block until the target position is reached
heuristicus Jul 6, 2023
24c556d
use self buffer to look up transform rather than creating a new one e…
heuristicus Jul 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions spot_cam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ add_service_files(

add_action_files(
FILES
CaptureImage.action
CaptureImageHighQuality.action
LookAtPoint.action
)

Expand Down
26 changes: 26 additions & 0 deletions spot_cam/action/CaptureImage.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Capture an image from the camera

# Select which screen should be captured. See /spot/cam/screens for valid options. If empty, captures the current screen
string screen

# Directory to which the image(s) should be saved
string save_dir

# Base filename for the image capture. This will be suffixed with the screen used for the capture, as well as the date
# and time of the capture. It will look something like filename_mech_2023-06-15-16-52-03.png. If not provided, the
# default filename is spot_cam_stream_capture. If you provide an extension with the base filename, output files will be saved
# with that extension rather than the default of png. For example, providing my_capture.jpg will generate jpg output
# See https://docs.opencv.org/3.4/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56 for valid extensions
string filename

# Duration in seconds for which the images should be captured. Each image received on the stream will be saved to a
# separate file. This takes precedence over capture_count
int32 capture_duration

# Specify the number of images which should be captured from the image stream. Not used if capture_duration is nonzero
int32 capture_count
-----
bool success
string message
---
string feedback
26 changes: 26 additions & 0 deletions spot_cam/action/CaptureImageHighQuality.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Capture a high quality image from the camera using MediaLog functionality.

# Select which camera should be captured. Valid options are pano, ir, ptz, c0, c1, c2, c3, c4
string camera

# Directory to which the image(s) should be saved
string save_dir

# Base filename for the image capture. This will be suffixed with the screen used for the capture, as well as the date
# and time of the capture. It will look something like filename_ptz_YYYY-mm-ddTHH-MM-SS.MS. If not provided, the
# default filename is spot_cam_capture. The extension for the file depends on the selected screen and options below.
string filename

# Determines the frequency at which images should be saved
float32 capture_frequency

# Duration in seconds for which images should be captured.
int32 capture_duration

# Specify the number of images which should be captured.
int32 capture_count
-----
bool success
string message
---
string feedback
2 changes: 2 additions & 0 deletions spot_cam/action/LookAtPoint.action
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ float32 image_width
float32 zoom_level
# If true, the camera will track this point as the robot moves
bool track
# If true, the action will not return until the camera is pointing approximately at the requested point
bool blocking
------
bool success
string message
Expand Down
Loading
Loading