Im trying to understand ardrone_autonomy code which is the ROS driver for parrot ar drone.
Here is the github page
Particularly I am looking at the following code from this part:
void CmdVelCallback(const geometry_msgs::TwistConstPtr &msg)
{
vp_os_mutex_lock(&twist_lock);
// Main 4DOF
cmd_vel.linear.x = std::max(std::min(-msg->linear.x, 1.0), -1.0);
cmd_vel.linear.y = std::max(std::min(-msg->linear.y, 1.0), -1.0);
cmd_vel.linear.z = std::max(std::min(msg->linear.z, 1.0), -1.0);
cmd_vel.angular.z = std::max(std::min(-msg->angular.z, 1.0), -1.0);
// These 2DOF just change the auto hover behaviour
// No bound() required
cmd_vel.angular.x = msg->angular.x;
cmd_vel.angular.y = msg->angular.y;
vp_os_mutex_unlock(&twist_lock);
}
1.) What are these vp_os_mutex_lock and vp_os_mutex_unlock ? I have tried to find their function definitions in the github page, but I couldn't. I have tried to googled them, but I couldn't find info about them also.
2.) According to this , if we want to fly the drone , we need to publish message to cmd_vel topic.
SO I expect the callback function (see the code above) to kinda send command to control the drone depending on the velocity input received, but I don't really understand the callback function here. What is it actually doing here?
3.) What is the data that the parrot ar drone's microcontroller expect to receive? WHat is the data type/variable name? Are they in ROS message format? Please elaborate on this
**4.) Is ROS actually installed in the ardrone microcontroller?? No right? **
5.) Similarly, what is the data that parrot ar dron's microcontroller send? I know that they send picture, sensor data, etc. My question is: Are the data format already in ROS message form? If no, please elaborate on this.
PS: According to ardrone_autonomy page : "Information received from the drone is published to the ardrone/navdata topic. The message type is ardrone_autonomy::Navdata"
But that one is published/done by the ROS Driver/ardrone_autonomy after filling the message right? WHat are the actual data received from the Drone?
6.) (Total newbie basic question. Sorry, please bear with me) ardrone_autonomy is a ROS driver for Parrot AR-Drone. So what does this ardrone_autonomy actually do? (please help me clarify things)
- It is running in our PC
- It establishes communication between PC and drone
- it receives data from drone to PC
- Those data can be used to perform some computation/algorithm in our computer to control the drone in more advanced way: e.g. navigation, obstacle avoidance, or whatever we implement
- This computation and algorithm^ is performed in our PC, not in the drone's microcontroller. Right?
- it sends data/command from PC to drone.
7.) I know that we can directly program in the drone's microcontroller. (Right?)
8.) Can you please help to explain where in the driver code does the conversion between the ROS data typle/message and the ARDrone data type happen?
Any help will be appreciated , Thanks!
Originally posted by alienmon on ROS Answers with karma: 582 on 2016-09-30
Post score: 0