• M100 (1) 运行


    软件环境设置指南
    本指南详细介绍了使用Onboard SDK所需的软件环境。
    https://developer.dji.com/onboard-sdk/documentation/development-workflow/environment-setup.html#all-platforms
    下载 电脑端调参软件
    - DJI Assistant 2 调参软件 v.1.1.2
    https://www.dji.com/cn/matrice600/info#downloads
    下载 手机端调参软件
    - DJL GO Creat
    https://www.dji.com/cn/goapp
    下载SDK

    https://developer.dji.com/cn/onboard-sdk/


    - 从Github

    下载板载SDK

    https://github.com/dji-sdk/Onboard-SDK

    下载板载SDK-ROS存储库 

    https://github.com/dji-sdk/Mobile-SDK-Android

    启用OSDK API

    激活账号

    https://developer.dji.com/cn/user/apps/#onboard

     l g

    <launch>
        <node pkg="dji_sdk" type="dji_sdk_node" name="dji_sdk" output="screen">
        <!-- node parameters -->
        <param name="serial_name" type="string" value="/dev/ttyUSB0"/>
        <param name="baud_rate" type="int" value="115200"/>
        <param name="app_id" type="int" value="1044132"/>
        <param name="app_version" type="int" value="1"/>
        <param name="align_time" type="bool" value="false"/>
        <param name="enc_key" type="string" value="c6e9959875a6bba94ef7ddf7720a8ff91c7daca74a67a432ad26847031a6786c"/>
        <param name="use_broadcast" type="bool" value="false"/>
        </node>
    </launch>
    

      

    0 升级

    遥控器升级到最新

    • 遥控器连接手机,下载升级包,手机直接升级

    飞行器固件升级 1.3.1.0

    • 连接windons下DJL Assistant 2 软件,自动升级
    • 升级过程不能中断,否则失败

    升级说明,

    1 硬件连接

    手机+遥控器   

    • 开启切换模式, 取消新手模式
    • 遥控器接入F挡

    飞机+电脑      

    • 开启USB-TTL 连接,NUC靠近开关黄色的USB口(USB0端口)
    • 飞机USB小口连接另一台电脑,打开DJL Assistant 2 软件
    • 设置串口波特率,开启SDK对勾

    2 程序启动

    在电脑上

    1. 编辑启动文件并在指定位置输入您的应用程序ID,密钥,波特率和端口名称:
     
    rosed dji_sdk sdk.launch
    

      

    首先获取usb端口打开权限

    echo 12 | sudo chmod 777 /dev/ttyUSB0
    

     运行官方运行文件

    roslaunch light_wings passThrough.launch
    

     运行控制节点

    rosrun dji_sdk_demo demo_mission
    

     当然可以写脚本一次运行 run.sh

    #!/bin/bash
    
    cd /home/light-wings/DJI/djim100_ws
    echo 12 | sudo chmod 777 /dev/ttyUSB0
    roslaunch light_wings passThrough.launch
    exit 0
    

     接着可以看到windos电脑下运行的DJL Assistant 2软件能够模拟飞行

    官方样例

    云台测试

    115200

    windos assitans 2 设置波特率

    ls /dev/tty*    //查USB端口
    echo 12 | sudo chmod 777 /dev/ttyUSB0 // 给权限
    roslaunch dji_sdk sdk.launch

    地面获取视频

    飞机视频---------------------遥控器+视频卡+电脑+运行USB视频读取

    这里写了个节点

    运行命令

    rosrun my_image_transport my_subscriber 
    

    代码

    #include <ros/ros.h>
    #include <image_transport/image_transport.h>
    #include <opencv2/highgui/highgui.hpp>
    #include <cv_bridge/cv_bridge.h>
    
    using namespace cv;
    using namespace std;
    
    void imageCallback(const sensor_msgs::ImageConstPtr& msg)
    {
      try
      {
        cv::imshow("view", cv_bridge::toCvShare(msg, "bgr8")->image);
      }
      catch (cv_bridge::Exception& e)
      {
        ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str());
      }
    }
    
    int main(int argc, char **argv)
    {
      ros::init(argc, argv, "image_listener");
      ros::NodeHandle nh;
      
      Mat im;
      VideoCapture cap(0);
      
      if(!cap.isOpened())
      {
          cout << "fail open." << endl;
      }
      
      while(true)
      {
          cap >> im;
          
          cvNamedWindow("im", 0);
          imshow("im", im);
          cvWaitKey(1);
      }
        
     
      
      //cv::namedWindow("view");
      //cv::startWindowThread();
      //image_transport::ImageTransport it(nh);
      //image_transport::Subscriber sub = it.subscribe("/stereo_camera/right/image_raw", 1, imageCallback);
    
      //ros::NodeHandle nh1;
      //cv::namedWindow("view1");
      //cv::startWindowThread();
     // image_transport::ImageTransport it(nh1);
     // image_transport::Subscriber sub1 = it.subscribe("/stereo_camera/left/image_raw", 1, imageCallback);
    
      //ros::spin();
      //cv::destroyWindow("view");
      return 0;
    }
    

     

    cmake_minimum_required(VERSION 2.8.3)
    project(my_image_transport)
    
    
    find_package(catkin REQUIRED COMPONENTS
      cv_bridge
      image_transport
      OpenCV
    )
    
    
    catkin_package(
    #  INCLUDE_DIRS include
    #  LIBRARIES my_image_transport
    #  CATKIN_DEPENDS cv_bridge image_transport
    #  DEPENDS system_lib
    )
    
    
    include_directories(
    # include
      ${catkin_INCLUDE_DIRS}
      ${OpenCV_INCLUDE_DIRS}
    )
    
    add_executable(my_publisher src/my_publisher.cpp)
    target_link_libraries(my_publisher ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
    
    add_executable(my_subscriber src/my_subscriber.cpp)
    target_link_libraries(my_subscriber ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
    

     

    <?xml version="1.0"?>
    <package format="2">
      <name>my_image_transport</name>
      <version>0.0.0</version>
      <description>The my_image_transport package</description>
    
      <maintainer email="light-wings@todo.todo">light-wings</maintainer>
    
    
      <license>TODO</license>
    
    
      <buildtool_depend>catkin</buildtool_depend>
      <build_depend>cv_bridge</build_depend>
      <build_depend>image_transport</build_depend>
      <build_depend>opencv2</build_depend>
      <build_export_depend>cv_bridge</build_export_depend>
      <build_export_depend>image_transport</build_export_depend>
      
      <exec_depend>cv_bridge</exec_depend>
      <exec_depend>image_transport</exec_depend>
      
      <!-- The export tag contains other, unspecified, tags -->
      <export>
        <!-- Other tools can request additional information be placed here -->
    
      </export>
    </package>
    
  • 相关阅读:
    springMVC后端返回数据到前端
    spring MVC配置
    SSM框架中配置静态资源加载
    js实践问题收集日记
    页面HTml学习笔记
    js页面传值实践
    struts2中jsp页面与action之间的传值
    json与Java对象的转换
    JDBC的简单应用
    新的开始,重新启用博客园
  • 原文地址:https://www.cnblogs.com/kekeoutlook/p/7689033.html
Copyright © 2020-2023  润新知