Skip to content

Bugfix/teleop stutter#76

Open
christomaszewski wants to merge 6 commits intomasterfrom
bugfix/teleop_stutter
Open

Bugfix/teleop stutter#76
christomaszewski wants to merge 6 commits intomasterfrom
bugfix/teleop_stutter

Conversation

@christomaszewski
Copy link
Member

Can we test and merge this into master? It should have fix issues Paul was experiencing in Mexico and Colombia. Also gets rid of the teleop stutter.

Chris Tomaszewski added 6 commits March 17, 2017 13:08
…ferences to robotutils library. Updated to Mapbox 4.2.2
…en thumb is not moved enough to generate unique commands. Previous behavior was boat would eventually stop if joystick was held in a single position for too long. New behavior is boat will continue to move as long as a connection is maintained and the joystick is held in a non zero positon.
…op_stutter

Lots of general cleanup.

# Conflicts:
#	.idea/libraries/animated_vector_drawable_23_4_0.xml
#	.idea/libraries/appcompat_v7_23_4_0.xml
#	.idea/libraries/design_23_4_0.xml
#	.idea/libraries/lost_1_1_1.xml
#	.idea/libraries/recyclerview_v7_23_4_0.xml
#	.idea/libraries/support_vector_drawable_23_4_0.xml
#	app/build.gradle
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/com/platypus/android/tablet/ConnectScreen.java
#	app/src/main/java/com/platypus/android/tablet/SettingsActivity.java
#	app/src/main/java/com/platypus/android/tablet/TeleOpPanel.java
#	app/src/main/res/drawable-hdpi/arrow.png
#	app/src/main/res/drawable-hdpi/ic_launcher.png
#	app/src/main/res/drawable-mdpi/arrow.png
#	app/src/main/res/drawable-mdpi/ic_launcher.png
#	app/src/main/res/drawable-xhdpi/ic_launcher.png
#	app/src/main/res/drawable-xxhdpi/ic_launcher.png
#	app/src/main/res/layout/maptest.xml
#	app/src/main/res/menu/loading_screen.xml
#	build.gradle
Copy link
Member

@psigen psigen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fighting the good fight @christomaszewski

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
buildToolsVersion "25.0.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line got duplicated for no reason.

if (mMapboxMap != null) {
mMapboxMap.setStyle(Style.SATELLITE);
mMapboxMap.setStyleUrl("mapbox://styles/mapbox/satellite-v9");
//mMapboxMap.setStyle(Style.SATELLITE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of old comments.

mMapboxMap.setStyleUrl("mapbox://styles/mapbox/streets-v9");
//mMapboxMap.setStyle(Style.MAPBOX_STREETS); //vector map
//mMapboxMap.setStyle(Style.SATELLITE_STREETS); //satalite
//mMapboxMap.setMyLocationEnabled(true); //show current location
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of unused comments.

ipAddressBox.setBackgroundColor(Color.GREEN);
}
if (connected == false) {
else if (!connected) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a boolean, you can just do else instead of else if. Or you can do a ternary like:

ipAddressBox.setBackgroundColor(connected ? Color.GREEN : Color.Red)

//if (currentBoat.getConnected() == true)
{
if (old_thrust != thrustTemp || old_rudder!=rudderTemp) {
//if (old_thrust != thrustTemp || old_rudder!=rudderTemp) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just get rid of these old comments. I have no idea what this is supposed to be doing but it looks like garbage.

@@ -2307,9 +2285,10 @@ public boolean isWaypointWithinDistance(LatLng a, LatLng b, double dist)
// double distanceBetweenPoints = Math.sqrt(x+y);
// //if (distanceBetweenPoints < dist)//0.0000449)
if (a.distanceTo(b) <= dist)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be:

return a.distanceTo(b) <= dist;

public void onClick(View v) {
if (containsRegion == true)
if (containsRegion)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird bracket indent, pull back to end of last line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments