-
Notifications
You must be signed in to change notification settings - Fork 121
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
Added wrapper for the move by command. #103
base: indigo-devel
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @AndreasAZiegler for this PR.
- Please see my inline comments.
- Please consider updating the documentation (in the
docs
folder) + add your information as a contributor to it. - Please consider adding unit tests for these two functionalities (check
bebop_driver/test
folder and this part of the docs)
exit(gen.generate(PACKAGE, "bebop_driver_nodelet", "BebopArdrone3")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert back changes to this file.
@@ -870,6 +870,12 @@ class Ardrone3PilotingStateAltitudeChanged : public AbstractState | |||
|
|||
}; // Ardrone3PilotingStateAltitudeChanged | |||
|
|||
// Relative move ended.\n Informs about the move that the drone managed to do and why it stopped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need the following class to be part of this file? Unfortunately this file is auto-generated and will be overwritten by subsequent SDK updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, shouldn't be needed. I guess I was not enough careful while adding files.
exit(gen.generate(PACKAGE, "bebop_driver_nodelet", "Bebop{{project}}")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert back changes to this file.
bebop_driver/src/bebop.cpp
Outdated
@@ -549,6 +549,20 @@ void Bebop::Move(const double &roll, const double &pitch, const double &gaz_spee | |||
} | |||
} | |||
|
|||
|
|||
void Bebop::MoveBy(const float& dX, const float& dY, const float& dZ, const float& dPsi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change float
to double
in the signature since the twist message fields (that you pass here) are all doubles.
@@ -232,6 +235,23 @@ void BebopDriverNodelet::CmdVelCallback(const geometry_msgs::TwistConstPtr& twis | |||
} | |||
} | |||
|
|||
void BebopDriverNodelet::CmdMoveByCallback(const geometry_msgs::TwistConstPtr& twist_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please lint
this function (indents, extra blank lines).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, if I understood your comment correctly. Pleas let me know, if it's the case.
{ | ||
try | ||
{ | ||
ROS_INFO("Setting picture format to %f", format_ptr->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think %f is correct here, since the input is of type uint8_t
. Please fix.
try | ||
{ | ||
ROS_INFO("Setting picture format to %f", format_ptr->data); | ||
bebop_ptr_->SetPictureFormat(format_ptr->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if format_ptr->data
is not set to a value supported by SetPictureFormat
? Please add a guard (or a warning) against this.
@@ -133,7 +133,7 @@ bool VideoDecoder::ReallocateBuffers() | |||
boost::lexical_cast<std::string>(codec_ctx_ptr_->width) + | |||
" x " + boost::lexical_cast<std::string>(codec_ctx_ptr_->width)); | |||
|
|||
const uint32_t num_bytes = avpicture_get_size(PIX_FMT_RGB24, codec_ctx_ptr_->width, codec_ctx_ptr_->width); | |||
const uint32_t num_bytes = avpicture_get_size(AV_PIX_FMT_RGB24, codec_ctx_ptr_->width, codec_ctx_ptr_->width); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current ffmpeg uses AV_PIX_FMT_RGB24. Older versions of ffmpeg provide PIX_FMT_RGB24.
@@ -143,12 +143,12 @@ bool VideoDecoder::ReallocateBuffers() | |||
std::string("Can not allocate memory for the buffer: ") + | |||
boost::lexical_cast<std::string>(num_bytes)); | |||
ThrowOnCondition(0 == avpicture_fill( | |||
reinterpret_cast<AVPicture*>(frame_rgb_ptr_), frame_rgb_raw_ptr_, PIX_FMT_RGB24, | |||
reinterpret_cast<AVPicture*>(frame_rgb_ptr_), frame_rgb_raw_ptr_, AV_PIX_FMT_RGB24, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
codec_ctx_ptr_->width, codec_ctx_ptr_->height), | ||
"Failed to initialize the picture data structure."); | ||
|
||
img_convert_ctx_ptr_ = sws_getContext(codec_ctx_ptr_->width, codec_ctx_ptr_->height, codec_ctx_ptr_->pix_fmt, | ||
codec_ctx_ptr_->width, codec_ctx_ptr_->height, PIX_FMT_RGB24, | ||
codec_ctx_ptr_->width, codec_ctx_ptr_->height, AV_PIX_FMT_RGB24, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
I applied your feedback and also added a unit test. As for the usage of the event "RELATIVE MOVE ENDED" arsdk version 3.12.6 is required, it would be good, if you can merge the PR "Add support for SDK 3.12.6 #120" before this one. I and then adapt the unit test accordingly. |
Added wrapper for the move by command in the Parrot SDK. This command moves the drone to a relative position and rotate heading by a given angle.