Skip to content

Commit abdf11c

Browse files
committed
Moving camera functionallity to its own App.
0 parents  commit abdf11c

16 files changed

+1032
-0
lines changed

AndroidManifest.xml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="org.chadrockey.android.android_camera_driver"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk android:minSdkVersion="13" />
8+
9+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
10+
<uses-permission android:name="android.permission.CAMERA" />
11+
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
12+
<uses-permission android:name="android.permission.INTERNET" />
13+
<uses-permission android:name="android.permission.WAKE_LOCK" />
14+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
15+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
16+
17+
<application
18+
android:icon="@drawable/icon"
19+
android:label="@string/app_name">
20+
<!-- android:debuggable="true" -->
21+
<activity
22+
android:name="org.chadrockey.android.android_camera_driver.MainActivity"
23+
android:configChanges="orientation|keyboardHidden"
24+
android:label="@string/app_name"
25+
android:screenOrientation="landscape" >
26+
<intent-filter>
27+
<action android:name="android.intent.action.MAIN" />
28+
29+
<category android:name="android.intent.category.LAUNCHER" />
30+
</intent-filter>
31+
</activity>
32+
<activity android:name="org.ros.android.MasterChooser" />
33+
34+
<service android:name="org.ros.android.NodeMainExecutorService" />
35+
</application>
36+
37+
</manifest>

README

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Authors:
2+
[email protected] (Chad Rockey)
3+
[email protected] (Axel Furlan)
4+
5+
This is an extension to the first version of the Ros Android Sensors Driver.
6+
It extends the driver to camera readings and updates the previous version to the post-gradle shift of the rosjava libs.
7+
Two compression methods are currently supported, PNG and JPEG (with selectable compression quality).
8+
The topic names are:
9+
10+
11+
/camera/camera_info
12+
/camera/image/compressed
13+
14+
15+
16+
17+
Compiling:
18+
19+
To compile it on you machine, please follow the detailed instructions at:
20+
21+
Rosjava:
22+
http://www.dobots.nl/blog/-/blogs/android-and-rosjava
23+
24+
Android OpenCV:
25+
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_binary_package.html
26+
27+
Once your environment is set, do the following steps:
28+
1) git clone the repo in the android_core folder (the same folder where tutorials are).
29+
2) Edit the settings.gradle file in the android_core folder, adding 'android_sensors_driver' at the end of the include list.
30+
3) cd android_sensors_driver; ../gradlew clean debug
31+
32+
Install the appropriate OpenCV from Google Play.
33+
34+
For the whole process of building, packing, installing into the phone and running the app in debug mode, use the buildAll.sh script.
35+
36+
Known issues:
37+
38+
1) The code for raw images is also written, although the funcion is currently disabled due to OutOfMemory exceptions and lack of time to debug them. Any help is welcome.
39+
2) A better UI would be needed, e.g. to set camera parameters (now everything is fixed at 640x480, far focus, ecc.)

build.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (C) 2011 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
dependencies {
18+
compile 'ros.rosjava_core:rosjava_tutorial_pubsub:0.0.0-SNAPSHOT'
19+
}
20+
21+
22+
debug.dependsOn project(':android_gingerbread_mr1').tasks.debug
23+

build.xml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="MainActivity" default="help">
3+
4+
<!-- The local.properties file is created and updated by the 'android' tool.
5+
It contains the path to the SDK. It should *NOT* be checked into
6+
Version Control Systems. -->
7+
<property file="local.properties" />
8+
9+
<!-- The ant.properties file can be created by you. It is only edited by the
10+
'android' tool to add properties to it.
11+
This is the place to change some Ant specific build properties.
12+
Here are some properties you may want to change/update:
13+
14+
source.dir
15+
The name of the source directory. Default is 'src'.
16+
out.dir
17+
The name of the output directory. Default is 'bin'.
18+
19+
For other overridable properties, look at the beginning of the rules
20+
files in the SDK, at tools/ant/build.xml
21+
22+
Properties related to the SDK location or the project target should
23+
be updated using the 'android' tool with the 'update' action.
24+
25+
This file is an integral part of the build system for your
26+
application and should be checked into Version Control Systems.
27+
28+
-->
29+
<property file="ant.properties" />
30+
31+
<!-- The project.properties file is created and updated by the 'android'
32+
tool, as well as ADT.
33+
34+
This contains project specific properties such as project target, and library
35+
dependencies. Lower level build properties are stored in ant.properties
36+
(or in .classpath for Eclipse projects).
37+
38+
This file is an integral part of the build system for your
39+
application and should be checked into Version Control Systems. -->
40+
<loadproperties srcFile="project.properties" />
41+
42+
<!-- quick check on sdk.dir -->
43+
<fail
44+
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
45+
unless="sdk.dir"
46+
/>
47+
48+
<!--
49+
Import per project custom build rules if present at the root of the project.
50+
This is the place to put custom intermediary targets such as:
51+
-pre-build
52+
-pre-compile
53+
-post-compile (This is typically used for code obfuscation.
54+
Compiled code location: ${out.classes.absolute.dir}
55+
If this is not done in place, override ${out.dex.input.absolute.dir})
56+
-post-package
57+
-post-build
58+
-pre-clean
59+
-->
60+
<import file="custom_rules.xml" optional="true" />
61+
62+
<!-- Import the actual build file.
63+
64+
To customize existing targets, there are two options:
65+
- Customize only one target:
66+
- copy/paste the target into this file, *before* the
67+
<import> task.
68+
- customize it to your needs.
69+
- Customize the whole content of build.xml
70+
- copy/paste the content of the rules files (minus the top node)
71+
into this file, replacing the <import> task.
72+
- customize to your needs.
73+
74+
***********************
75+
****** IMPORTANT ******
76+
***********************
77+
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
78+
in order to avoid having your file be overridden by tools such as "android update project"
79+
-->
80+
<!-- version-tag: 1 -->
81+
<import file="${sdk.dir}/tools/ant/build.xml" />
82+
83+
</project>

buildAll.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Bash
2+
3+
../gradlew clean debug
4+
if [ $? -eq 0 ]
5+
then
6+
adb uninstall org.chadrockey.android.android_camera_driver
7+
adb install bin/MainActivity-debug.apk
8+
adb shell am start -n org.chadrockey.android.android_camera_driver/org.chadrockey.android.android_camera_driver.MainActivity
9+
adb logcat -c
10+
adb logcat
11+
fi

local.properties

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must *NOT* be checked into Version Control Systems,
5+
# as it contains information specific to your local configuration.
6+
7+
# location of the SDK. This is only used by Ant
8+
# For customization when using a Version Control System, please read the
9+
# header note.
10+
sdk.dir=/home/willow/NVPACK/android-sdk-linux

mainpage.dox

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
\mainpage
3+
\htmlinclude manifest.html
4+
5+
\b android_camera_driver is ...
6+
7+
<!--
8+
Provide an overview of your package.
9+
-->
10+
11+
12+
\section codeapi Code API
13+
14+
<!--
15+
Provide links to specific auto-generated API documentation within your
16+
package that is of particular interest to a reader. Doxygen will
17+
document pretty much every part of your code, so do your best here to
18+
point the reader to the actual API.
19+
20+
If your codebase is fairly large or has different sets of APIs, you
21+
should use the doxygen 'group' tag to keep these APIs together. For
22+
example, the roscpp documentation has 'libros' group.
23+
-->
24+
25+
26+
*/

manifest.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<package>
2+
<description brief="android_camera_driver">
3+
android_camera_driver
4+
</description>
5+
<author>Chad Rockey ([email protected])</author>
6+
<license>Apache 2.0</license>
7+
<review status="unreviewed" notes="" />
8+
<url>http://ros.org/wiki/android_camera_driver</url>
9+
</package>

proguard-project.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}

project.properties

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system use,
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
10+
# Project target.
11+
target=android-13
12+
#android.library=true
13+
android.library.reference.1=../android_gingerbread_mr1
14+
android.library.reference.2=../../OpenCV-2.4.2-android-sdk/sdk/java

res/layout/main.xml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:orientation="vertical" >
6+
7+
<org.ros.android.view.camera.RosCameraPreviewView
8+
android:id="@+id/ros_camera_preview_view"
9+
android:layout_width="fill_parent"
10+
android:layout_height="fill_parent" />
11+
12+
<org.ros.android.view.RosTextView
13+
android:id="@+id/text"
14+
android:layout_width="fill_parent"
15+
android:layout_height="wrap_content"
16+
android:textSize="30dip" />
17+
18+
</LinearLayout>

res/values/strings.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name">ROS Android Camera Driver</string>
4+
</resources>

0 commit comments

Comments
 (0)