Skip to content

Commit

Permalink
repository refactor and color change finished - no testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Iosu Sanchez committed May 17, 2021
1 parent 7a82220 commit 32ed8c2
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 26 deletions.
Binary file modified app/release/app-release.apk
Binary file not shown.
19 changes: 0 additions & 19 deletions app/src/main/java/com/github/gidabotapp/repository/QNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import androidx.lifecycle.MutableLiveData;

import com.github.gidabotapp.data.MultiNavPhase;
import com.github.gidabotapp.data.PhaseMessage;
import com.github.gidabotapp.domain.Floor;
import com.github.gidabotapp.domain.MapPosition;
Expand Down Expand Up @@ -51,14 +50,12 @@ public class QNode extends AbstractNodeMain {
// Node subscribers
private HashMap<Floor, Subscriber<PoseWithCovarianceStamped>> positionSubHM;
private HashMap<Floor, Subscriber<PendingGoals>> pendingReqSubHM;
private Subscriber<std_msgs.Int8> subNavPhase;
private Subscriber<std_msgs.Int8> subDialogMessage;

// All MutableLiveData to expose ROS system's current data
private final HashMap<Floor, MutableLiveData<MapPosition>> currentPositionsHM;
private final HashMap<Floor, MutableLiveData<List<Goal>>> pendingRequestsHM;
private final MutableLiveData<PhaseMessage> phaseMessageLD;
private final MutableLiveData<MultiNavPhase> multiNavPhaseLD;

// ConnectedNode will be injected through MainActivity (RosActivity)
private ConnectedNode connectedNode;
Expand Down Expand Up @@ -87,7 +84,6 @@ private QNode() {
}
}};
this.phaseMessageLD = new MutableLiveData<>();
this.multiNavPhaseLD = new MutableLiveData<>();
}

// Singleton lazy initialization
Expand Down Expand Up @@ -151,17 +147,6 @@ public void onNewMessage(PendingGoals message) {
}};


// Nav Phase subscriber connection
subNavPhase = connectedNode.newSubscriber("/nav_phase", Int8._TYPE);
subNavPhase.addMessageListener(new MessageListener<Int8>() {
@Override
public void onNewMessage(Int8 message) {
int i = message.getData();
MultiNavPhase currentNavPhase = MultiNavPhase.values()[i];
multiNavPhaseLD.postValue(currentNavPhase);
}
});

// Dialog QT message subscriber connection
subDialogMessage = connectedNode.newSubscriber("/dialog_qt_message", Int8._TYPE);
subDialogMessage.addMessageListener(new MessageListener<Int8>() {
Expand Down Expand Up @@ -282,7 +267,6 @@ public void shutdown() {
}

subDialogMessage.shutdown();
subNavPhase.shutdown();

pubCancel.shutdown();
pubGoal.shutdown();
Expand All @@ -302,9 +286,6 @@ public void shutdown() {
public MutableLiveData<PhaseMessage> getPhaseMessageLD(){
return this.phaseMessageLD;
}
public MutableLiveData<MultiNavPhase> getMultiNavPhaseLD(){
return this.multiNavPhaseLD;
}
public HashMap<Floor, MutableLiveData<MapPosition>> getCurrentPositionsHM(){
return this.currentPositionsHM;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ public void qNodeShutdown() {
public LiveData<Integer> getAlertLD(){
return this.alertLD;
}
public MutableLiveData<MultiNavPhase> getMultiNavPhaseLD(){
return qNode.getMultiNavPhaseLD();
}
public MutableLiveData<Integer> getToastLD(){
return this.toastLD;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ public void onDestroy() {
viewModel.getPositionLD(floor).removeObservers(this);
}
viewModel.getCurrentFloorRoomsLD().removeObservers(this);
viewModel.getMultiNavPhaseLD().removeObservers(this);

// Shut down robot query Node (qNode)
viewModel.shutdownNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ public void selectFloor(Floor floor) {
public LiveData<String> getToastLD() {
return this.toastLD;
}
public MutableLiveData<MultiNavPhase> getMultiNavPhaseLD(){
return repository.getMultiNavPhaseLD();
}
public MutableLiveData<MapPosition> getPositionLD(Floor f){
return repository.getCurrentPositionsHM().get(f);
}
Expand Down

0 comments on commit 32ed8c2

Please sign in to comment.