Added wrapper for the move by command.#103
Added wrapper for the move by command.#103AndreasAZiegler wants to merge 26 commits intoAutonomyLab:indigo-develfrom
Conversation
mani-monaj
left a comment
There was a problem hiding this comment.
Thank you @AndreasAZiegler for this PR.
- Please see my inline comments.
- Please consider updating the documentation (in the
docsfolder) + add your information as a contributor to it. - Please consider adding unit tests for these two functionalities (check
bebop_driver/testfolder and this part of the docs)
|
|
||
|
|
||
| exit(gen.generate(PACKAGE, "bebop_driver_nodelet", "BebopArdrone3")) No newline at end of file | ||
| exit(gen.generate(PACKAGE, "bebop_driver_nodelet", "BebopArdrone3")) |
There was a problem hiding this comment.
Please revert back changes to this file.
|
|
||
| }; // 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.
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.
No, shouldn't be needed. I guess I was not enough careful while adding files.
| {{/cfg_class}} | ||
|
|
||
| exit(gen.generate(PACKAGE, "bebop_driver_nodelet", "Bebop{{project}}")) No newline at end of file | ||
| exit(gen.generate(PACKAGE, "bebop_driver_nodelet", "Bebop{{project}}")) |
There was a problem hiding this comment.
Please revert back changes to this file.
bebop_driver/src/bebop.cpp
Outdated
| } | ||
|
|
||
|
|
||
| void Bebop::MoveBy(const float& dX, const float& dY, const float& dZ, const float& dPsi) |
There was a problem hiding this comment.
Please change float to double in the signature since the twist message fields (that you pass here) are all doubles.
| } | ||
| } | ||
|
|
||
| void BebopDriverNodelet::CmdMoveByCallback(const geometry_msgs::TwistConstPtr& twist_ptr) |
There was a problem hiding this comment.
Please lint this function (indents, extra blank lines).
There was a problem hiding this comment.
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.
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.
What if format_ptr->data is not set to a value supported by SetPictureFormat? Please add a guard (or a warning) against this.
| " 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.
Could you please explain this change?
There was a problem hiding this comment.
The current ffmpeg uses AV_PIX_FMT_RGB24. Older versions of ffmpeg provide PIX_FMT_RGB24.
| 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, |
|
|
||
| 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, |
|
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.