Skip to content

Commit 8fbac93

Browse files
authored
Merge pull request #34 from MobileRoboticsSkoltech/remote_fixes
Remote feature fixes
2 parents c2724ac + a1769a3 commit 8fbac93

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ before_install:
3333
- openssl aes-256-cbc -K $encrypted_9e5ce9a0670f_key -iv $encrypted_9e5ce9a0670f_iv -in opencamera-extended-firebase-adminsdk-yv5yz-e33a8ce5c1.json.enc -out ./opencamera-extended-firebase-adminsdk-yv5yz-e33a8ce5c1.json -d
3434
- openssl aes-256-cbc -K $encrypted_cec398169802_key -iv $encrypted_cec398169802_iv -in my-release-key.keystore.enc -out ./my-release-key.keystore -d
3535
- yes | sdkmanager "platforms;android-28"
36+
- curl -L https://packagecloud.io/github/git-lfs/gpgkey | sudo apt-key add -
3637

3738
cache:
3839
directories:
3940
- "$HOME/google-cloud-sdk/"
4041

4142
before_script:
43+
- python3.6 --version
44+
- export CLOUDSDK_PYTHON=$(which python3.6)
4245
- gcloud version || true
4346
- export CLOUDSDK_CORE_DISABLE_PROMPTS=1
4447
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; curl https://sdk.cloud.google.com | bash; fi

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ OpenCamera Sensors is an Android application for synchronized recording of video
1212

1313
OpenCamera Sensors is an Android application for synchronized recording of video and IMU data. It records IMU data and video with frame timestamps synced to the same clock.
1414

15-
1615
This project is based on [Open Camera](https://opencamera.org.uk/) — a popular open-source camera application with flexibility in camera parameters settings, actively supported by the community. By regular merging of Open Camera updates our app will adapt to new smartphones and APIs — this is an advantage over the other video + IMU recording applications built from scratch for Camera2API.
1716

1817
## Usage

app/src/main/java/net/sourceforge/opencamera/MainActivity.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ private void onCreateInner(Bundle savedInstanceState) {
263263
if( MyDebug.LOG )
264264
Log.d(TAG, "onCreate: time after setting default preference values: " + (System.currentTimeMillis() - debug_time));
265265

266+
// Enable all sensors on startup
267+
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
268+
SharedPreferences.Editor prefEditor = sharedPreferences.edit();
269+
prefEditor.putBoolean(PreferenceKeys.AccelPreferenceKey, true);
270+
prefEditor.putBoolean(PreferenceKeys.GyroPreferenceKey, true);
271+
prefEditor.putBoolean(PreferenceKeys.MagnetometerPrefKey, true);
272+
prefEditor.apply();
273+
274+
266275
if( getIntent() != null && getIntent().getExtras() != null ) {
267276
// whether called from testing
268277
is_test = getIntent().getExtras().getBoolean("test_project");
@@ -283,7 +292,6 @@ private void onCreateInner(Bundle savedInstanceState) {
283292
if( MyDebug.LOG )
284293
Log.d(TAG, "shortcut: " + getIntent().getAction());
285294
}
286-
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
287295

288296
// determine whether we should support "auto stabilise" feature
289297
// risk of running out of memory on lower end devices, due to manipulation of large bitmaps
@@ -365,7 +373,7 @@ private void onCreateInner(Bundle savedInstanceState) {
365373
mainUI.closeExposureUI();
366374

367375
// set up the camera and its preview
368-
preview = new Preview(applicationInterface, ((ViewGroup) this.findViewById(R.id.preview)));
376+
preview = new Preview(applicationInterface, this.findViewById(R.id.preview));
369377
if( MyDebug.LOG )
370378
Log.d(TAG, "onCreate: time after creating preview: " + (System.currentTimeMillis() - debug_time));
371379

app/src/main/java/net/sourceforge/opencamera/sensorremote/RemoteRpcRequestHandler.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package net.sourceforge.opencamera.sensorremote;
22

3-
import android.content.SharedPreferences;
43
import android.hardware.Sensor;
5-
import android.preference.PreferenceManager;
64
import android.util.Log;
75

86
import net.sourceforge.opencamera.ExtendedAppInterface;
97
import net.sourceforge.opencamera.MainActivity;
108
import net.sourceforge.opencamera.MyDebug;
11-
import net.sourceforge.opencamera.PreferenceKeys;
129
import net.sourceforge.opencamera.preview.Preview;
1310
import net.sourceforge.opencamera.sensorlogging.RawSensorInfo;
1411
import net.sourceforge.opencamera.sensorlogging.VideoPhaseInfo;
@@ -70,12 +67,12 @@ RemoteRpcResponse handleImuRequest(long durationMillis, boolean wantAccel, boole
7067
if (mRawSensorInfo != null && !mRawSensorInfo.isRecording()) {
7168
// TODO: custom rates?
7269
Callable<Void> recStartCallable = () -> {
73-
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
74-
SharedPreferences.Editor prefEditor = sharedPreferences.edit();
75-
prefEditor.putBoolean(PreferenceKeys.AccelPreferenceKey, wantAccel);
76-
prefEditor.putBoolean(PreferenceKeys.GyroPreferenceKey, wantGyro);
77-
prefEditor.putBoolean(PreferenceKeys.MagnetometerPrefKey, wantMagnetic);
78-
prefEditor.apply();
70+
// SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
71+
// SharedPreferences.Editor prefEditor = sharedPreferences.edit();
72+
// prefEditor.putBoolean(PreferenceKeys.AccelPreferenceKey, wantAccel);
73+
// prefEditor.putBoolean(PreferenceKeys.GyroPreferenceKey, wantGyro);
74+
// prefEditor.putBoolean(PreferenceKeys.MagnetometerPrefKey, wantMagnetic);
75+
// prefEditor.apply();
7976

8077
Date currentDate = new Date();
8178
mContext.getApplicationInterface().startImu(wantAccel, wantGyro, wantMagnetic, currentDate);

0 commit comments

Comments
 (0)