< >
Home » ROS与AR.Drone教程 » ROS与AR.Drone-tum_ardrone-问题和技巧

ROS与AR.Drone-tum_ardrone-问题和技巧

问题和技巧

问题

  • Ar.Drone 1.0版本,压力传感器和磁力计是不使用。
  • PTAM初始化失败会导致drone_stateestimation经常崩溃(崩溃发生在PTAM代码)。发生在oarticular,如头两个keyframes之间没有基线。很少发生在praxis。

提示和技巧

  1. 相机标定
front, old drone: 0.672049, 0.899033, 0.502065, 0.513876, 0.271972
front, new drone: 0.771557, 1.368560, 0.552779, 0.444056, 1.156010

calibrate with ethzasl_ptam. to work with colored images, in src/CameraCalibrator.cc change:
用ethzasl_ptam做标定,跟有色的图片一起工作,在src/CameraCalibrator.cc改变:

    增加 #include (缺译者注)
    改变 function imageCallback(...) to

void CameraCalibrator::imageCallback(const sensor_msgs::ImageConstPtr & img)
{
    cv_bridge::CvImagePtr cv_ptr = cv_bridge::toCvCopy(img, sensor_msgs::image_encodings::MONO8);

    if(mCurrentImage.size().x != img->width || mCurrentImage.size().y != img->height)
        mCurrentImage.resize(CVD::ImageRef(img->width, img->height));

    memcpy(mCurrentImage.data(),cv_ptr->image.data,img->width * img->height);

    mNewImage = true;
}

参数: c1 to c8

可以评估更容易:

  • 记录飞行: rosbag record -O calibFlight.bag /ardrone/image_raw /ardrone/navdata /cmd_vel
  • 回放:rosbag play -l calibFlight.bag
  • 打开两个状态评估节点:其一重定义名称
rosrun tum_ardrone drone_stateestimation __name:=drone_stateestimationn2 /ardrone/predictedPose:=/ardrone/predictedPose2
rosrun tum_ardrone drone_stateestimation
  • 绘制各自的评估值
rxplot /ardrone/predictedPose/dx,/ardrone/predictedPose2/dx
  • 使用动态配置
in drone_stateestimation2, use only control gains
in drone_stateestimation, use NO control gains, but instead navdata / speeds / PTAM.
  • setting c_i drone_stateestimation2 such that graphs match best (play around).

参数: PID control

approximate in "simulation" based on c1 to c8:

  • play back any record, to make stateestimation run (dont play /cmd_vel)
rosbag play -l calibFlightZ.bag --topics /ardrone/image_raw /ardrone/navdata
  • run stateestimation, in dynamic reconfigure set only control updates to be used
  • run gui and autopilot, and control
  • plot control / respective pose e.g. with
rxplot /ardrone/predictedPose/yaw /cmd_vel/angular/z

参考:

  • https://github.com/tum-vision/tum_ardrone

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ros ar.drone, tum_ardrone, ar.drone