Skip to content

Commit

Permalink
Loaded atomic for json
Browse files Browse the repository at this point in the history
  • Loading branch information
Geeoon committed Oct 10, 2023
1 parent b48e412 commit ca2b299
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/network/MissionControlProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void MissionControlProtocol::handleSetArmIKEnabled(const json& j) {
_arm_ik_repeat_thread.join();
}
}
sendArmIKEnabledReport(Globals::armIKEnabled);
sendArmIKEnabledReport();
}

void MissionControlProtocol::setRequestedCmdVel(double dtheta, double dx) {
Expand Down Expand Up @@ -268,7 +268,7 @@ void MissionControlProtocol::handleCameraStreamCloseRequest(const json& j) {
}

void MissionControlProtocol::sendArmIKEnabledReport() {
json msg = {{"type", ARM_IK_ENABLED_REP_TYPE}, {"enabled", Globals::armIKEnabled}};
json msg = {{"type", ARM_IK_ENABLED_REP_TYPE}, {"enabled", Globals::armIKEnabled.load()}};
this->_server.sendJSON(Constants::MC_PROTOCOL_NAME, msg);
}

Expand Down
2 changes: 1 addition & 1 deletion src/network/MissionControlProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MissionControlProtocol : public WebSocketProtocol { // TODO: add documenta
void handleJointPowerRequest(const json& j);
void handleDriveRequest(const json& j);
void handleRequestArmIKEnabled(const json& j);
void sendArmIKEnabledReport(const bool& isEnabled);
void sendArmIKEnabledReport();
void sendCameraStreamReport(const CameraID& cam,
const std::vector<std::basic_string<uint8_t>>& videoData);
void sendJointPositionReport(const std::string& jointName, int32_t position);
Expand Down

0 comments on commit ca2b299

Please sign in to comment.