Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
5f0bd3d4
Commit
5f0bd3d4
authored
Feb 13, 2017
by
Gus Grubba
Browse files
Experimenting with Video / Photo commands
parent
2dbd131b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/uas/UAS.cc
View file @
5f0bd3d4
...
@@ -1209,15 +1209,46 @@ void UAS::setManual6DOFControlCommands(double x, double y, double z, double roll
...
@@ -1209,15 +1209,46 @@ void UAS::setManual6DOFControlCommands(double x, double y, double z, double roll
*/
*/
void
UAS
::
pairRX
(
int
rxType
,
int
rxSubType
)
void
UAS
::
pairRX
(
int
rxType
,
int
rxSubType
)
{
{
if
(
!
_vehicle
)
{
if
(
_vehicle
)
{
return
;
_vehicle
->
sendMavCommand
(
_vehicle
->
defaultComponentId
(),
// target component
MAV_CMD_IMAGE_START_CAPTURE
,
// command id
MAV_CMD_START_RX_PAIR
,
// command id
true
,
// showError
rxType
,
rxSubType
);
}
}
}
_vehicle
->
sendMavCommand
(
_vehicle
->
defaultComponentId
(),
// target component
/**
MAV_CMD_START_RX_PAIR
,
// command id
* Order the robot to take a picture (Testing -- Incomplete API)
true
,
// showError
*/
rxType
,
void
UAS
::
takePhoto
()
rxSubType
);
{
if
(
_vehicle
)
{
_vehicle
->
sendMavCommand
(
_vehicle
->
defaultComponentId
(),
// target component
MAV_CMD_IMAGE_START_CAPTURE
,
// command id
0
,
// Duration between two consecutive pictures (in seconds)
1
,
// Number of images to capture total - 0 for unlimited capture
0
,
// Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc), set to 0 if param 4/5 are used
1920
,
// Resolution horizontal in pixels
1080
);
// Resolution horizontal in pixels
}
}
/**
* Order the robot to toggle video recording (Testing -- Incomplete API)
*/
void
UAS
::
toggleVideo
()
{
if
(
_vehicle
)
{
_vehicle
->
sendMavCommand
(
_vehicle
->
defaultComponentId
(),
// target component
MAV_CMD_VIDEO_START_CAPTURE
,
// command id
0
,
// Camera ID (0 for all cameras), 1 for first, 2 for second, etc.
60
,
// Frames per second
0
,
// Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc), set to 0 if param 4/5 are used
1920
,
// Resolution horizontal in pixels
1080
);
// Resolution horizontal in pixels
}
}
}
/**
/**
...
...
src/uas/UAS.h
View file @
5f0bd3d4
...
@@ -262,6 +262,10 @@ public:
...
@@ -262,6 +262,10 @@ public:
public
slots
:
public
slots
:
/** @brief Order the robot to pair its receiver **/
/** @brief Order the robot to pair its receiver **/
void
pairRX
(
int
rxType
,
int
rxSubType
);
void
pairRX
(
int
rxType
,
int
rxSubType
);
/** @brief Order the robot to take a picture **/
void
takePhoto
();
/** @brief Order the robot to toggle video recording **/
void
toggleVideo
();
/** @brief Enable / disable HIL */
/** @brief Enable / disable HIL */
#ifndef __mobile__
#ifndef __mobile__
...
...
src/uas/UASInterface.h
View file @
5f0bd3d4
...
@@ -137,6 +137,10 @@ public:
...
@@ -137,6 +137,10 @@ public:
public
slots
:
public
slots
:
/** @brief Order the robot to pair its receiver **/
/** @brief Order the robot to pair its receiver **/
virtual
void
pairRX
(
int
rxType
,
int
rxSubType
)
=
0
;
virtual
void
pairRX
(
int
rxType
,
int
rxSubType
)
=
0
;
/** @brief Order the robot to take a picture **/
virtual
void
takePhoto
()
{}
/** @brief Order the robot to toggle video recording **/
virtual
void
toggleVideo
()
{}
/** @brief Send the full HIL state to the MAV */
/** @brief Send the full HIL state to the MAV */
#ifndef __mobile__
#ifndef __mobile__
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment