主页
电子
模型
机器人
互动实验
机器人
ROS机器人Diego 1#制作(三十五)DiegoAPP–整体架构介绍
robot
2020年5月11日
1005
##1.开发环境 RobotCA是采用Eclipse进行开发,在DiegoAPP中将整个项目迁移到了Android Studio 3.4开发,并做了升级,支持最新Android版本。  Android Studio中Gradle 和Gradle Plugin的版本入下图,Gradle和Gradle Plugin的版本非常重要,其他的版本会出现一些编译错误。  Diego APP支持了Android8.0,Android8.1,Android9.0版本,适应现在主流的Android手机,其他版本的也可以下载最新的Android SDK进行编译,但有由于Android升级过程中接口函数会有所变化,故可能会影响正常的运行,如闪退等异常。  ##2.项目架构 Diego APP的目录组织结构符合Android Studio APP的项目组织规范  com.diegorobot.app是主要的程序目录 - Core:主要的控制逻辑代码,包括Robot的控制,Map,导航等。 - Dialogs:对话框的逻辑代码,对应res中的对话框资源 - Fragments:对应与res中视图的控制代码 - Layers:针对需要渲染的层的逻辑代码,现在只有针对激光雷达数据的渲染代码 - Views:对应res的视图文件的控制代码 - ControlAPP:主要的控制Activity,APP在连接进入控制模式后,运行此Activity - RobotChooser:APP启动时的Activity,用来配置连接信息,显示Robot列表 - ToolbarActionItemTarget:Robot列表中的工具条对应的类 Build.gradle App的编译配置文件中定义了App支持的版本,依赖的包等信息,特别是编译时所涉及到包,一定要正确,否则会出现编译异常, build.gradle代码如下 apply plugin: 'com.android.application' android { compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { applicationId "com.diegorobot.app" minSdkVersion 26 targetSdkVersion 28 multiDexEnabled true versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } dexOptions { javaMaxHeapSize "4g" } } configurations { all*.exclude group: 'org.ros.rosjava_bootstrap', module: 'gradle_plugins' } repositories { mavenLocal() mavenCentral() maven { url "https://github.com/rosjava/rosjava_mvn_repo/raw/master" } //maven { url "https://jitpack.io" } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:support-v4:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:cardview-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'org.ros.android_core:android_core_components:0.4.0' implementation 'com.github.rosjava.android_extras:gingerbread:[0.3,0.4)' implementation 'org.ros.rosjava_messages:tf2_msgs:[0.5,0.6)' implementation 'com.google.code.gson:gson:2.8.5' implementation 'org.apache.commons:commons-lang3:3.9' implementation 'com.squareup.okhttp:okhttp:2.7.5' implementation 'com.github.amlcurran.showcaseview:library:5.4.3' //testCompile 'junit:junit:4.12' } dependencies { // Required -- JUnit 4 framework testImplementation 'junit:junit:4.12' // Optional -- Mockito framework testImplementation 'org.mockito:mockito-core:2.27.0' androidTestImplementation 'com.android.support:support-annotations:28.0.0' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test:rules:1.0.2' // Optional -- Hamcrest library androidTestImplementation 'org.hamcrest:hamcrest-library:2.1' // Optional -- UI testing with Espresso androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' // Optional -- UI testing with UI Automator // androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v15' } configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' resolutionStrategy.force 'junit:junit:4.12' } ##3. 下载 请点击<a href="/blog/dl/app-release.apk" class="btn btn-icon mr-1" data-toggle="tooltip" title='下载'><i class="fa fa-download"></i>下载</a>,或者用手机浏览器扫描如下二维码。 
树莓派
机器人
四轴无人机
0 评论
发表评论
搜索
公众号
少而好学,如日出之阳。
最新文章
模型
又一款乐高弹射器
robot
2021年2月17日
模型
MOC-2412 大皮卡
robot
2021年2月17日
模型
乐高烈火摩托车
robot
2021年2月17日
模型
乐高弹射器
robot
2021年2月17日
模型
乐高弩箭
robot
2021年2月17日
模型
乐高小手枪
robot
2021年2月17日
小编推荐
机器人
ROS机器人Diego 1#制作(三十二)机器视觉 -整合Tensorflow MNIST,玩数字识别
robot
2020年4月30日
50K
电子
树莓派制造低成本交互式显微镜
robot
2020年6月27日
50K
电子
树莓派制造的绘图机器人
robot
2020年4月13日
50K
电子
特斯拉+树莓派实现车牌识别检测系统
robot
2020年4月16日
50K
电子
三维激光扫描建模仪(基于树莓派)
robot
2020年4月11日
50K
发表评论