feat: 增加对讲
This commit is contained in:
parent
21adafc3be
commit
d1e139ad71
@ -8,6 +8,7 @@ import "cmvr/api/arm_command.proto";
|
||||
service ArmService {
|
||||
rpc torqueOff(CommandHeader.Request) returns (CommandHeader.Feedback);
|
||||
rpc torqueOn(CommandHeader.Request) returns (CommandHeader.Feedback);
|
||||
rpc clearFault(CommandHeader.Request) returns (CommandHeader.Feedback);
|
||||
rpc moveJ(MoveJ.Request) returns (MoveJ.Response);
|
||||
rpc moveL(MoveL.Request) returns (MoveL.Response);
|
||||
rpc speedJ(SpeedJ.Request) returns (SpeedJ.Response);
|
||||
|
||||
@ -29,6 +29,22 @@ message CommandHeader {
|
||||
}
|
||||
}
|
||||
|
||||
message AudioData {
|
||||
enum AudioFormat {
|
||||
PCM = 0;
|
||||
MP3 = 1;
|
||||
AAC = 2;
|
||||
WAV = 3;
|
||||
}
|
||||
bytes data = 1;
|
||||
int32 sample_rate = 2;
|
||||
int32 channels = 3;
|
||||
AudioFormat format = 4;
|
||||
string codec = 5;
|
||||
int64 pts = 6;
|
||||
int32 nb_samples = 7;
|
||||
}
|
||||
|
||||
message ConfigParam {
|
||||
|
||||
string param_name = 1;
|
||||
|
||||
92
server/proto/cmvr/api/microphone_command.proto
Normal file
92
server/proto/cmvr/api/microphone_command.proto
Normal file
@ -0,0 +1,92 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "cmvr/api/common.proto";
|
||||
|
||||
package cmvr.api;
|
||||
|
||||
message MicState {
|
||||
bool is_initialized = 1;
|
||||
bool is_running = 2;
|
||||
bool is_recording = 3;
|
||||
int32 volume = 4;
|
||||
string error_message = 5;
|
||||
}
|
||||
|
||||
message GetMicStateCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
MicState state = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message StartMicRecordingCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
string file_path = 2;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message StopMicRecordingCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message PauseMicRecordingCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message ResumeMicRecordingCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message StreamMicAudioCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
AudioData audio = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message SetMicPhoneVolumeCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
int32 volume = 2;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message GetMicPhoneVolumeCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
int32 volume = 2;
|
||||
}
|
||||
}
|
||||
17
server/proto/cmvr/api/microphone_service.proto
Normal file
17
server/proto/cmvr/api/microphone_service.proto
Normal file
@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "cmvr/api/microphone_command.proto";
|
||||
|
||||
package cmvr.api;
|
||||
|
||||
service MicPhoneService {
|
||||
rpc GetStatus(GetMicStateCommand.Request) returns (GetMicStateCommand.Feedback);
|
||||
rpc StartRecord(StartMicRecordingCommand.Request) returns (StartMicRecordingCommand.Feedback);
|
||||
rpc StopRecord(StopMicRecordingCommand.Request) returns (StopMicRecordingCommand.Feedback);
|
||||
rpc PauseRecord(PauseMicRecordingCommand.Request) returns (PauseMicRecordingCommand.Feedback);
|
||||
rpc ResumeRecord(ResumeMicRecordingCommand.Request) returns (ResumeMicRecordingCommand.Feedback);
|
||||
rpc StreamAudio(StreamMicAudioCommand.Request) returns (stream StreamMicAudioCommand.Feedback);
|
||||
|
||||
rpc SetVolume(SetMicPhoneVolumeCommand.Request) returns (SetMicPhoneVolumeCommand.Feedback);
|
||||
rpc GetVolume(GetMicPhoneVolumeCommand.Request) returns (GetMicPhoneVolumeCommand.Feedback);
|
||||
}
|
||||
92
server/proto/cmvr/api/speaker_command.proto
Normal file
92
server/proto/cmvr/api/speaker_command.proto
Normal file
@ -0,0 +1,92 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "cmvr/api/common.proto";
|
||||
|
||||
package cmvr.api;
|
||||
|
||||
message SpeakerState {
|
||||
bool is_initialized = 1;
|
||||
bool is_running = 2;
|
||||
bool is_decoding = 3;
|
||||
bool is_paused = 5;
|
||||
int32 volume = 6;
|
||||
string error_message = 7;
|
||||
}
|
||||
|
||||
message GetSpeakerStateCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
SpeakerState state = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message PlayAudioCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
string audio_path = 2;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message StreamSpeakerAudioCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
AudioData audio = 2;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message StopSpeakerCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message PauseSpeakerCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message ResumeSpeakerCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message SetSpeakerVolumeCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
int32 volume = 2;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message GetSpeakerVolumeCommand {
|
||||
message Request {
|
||||
CommandHeader.Request header = 1;
|
||||
}
|
||||
message Feedback {
|
||||
CommandHeader.Feedback header = 1;
|
||||
int32 volume = 2;
|
||||
}
|
||||
}
|
||||
17
server/proto/cmvr/api/speaker_service.proto
Normal file
17
server/proto/cmvr/api/speaker_service.proto
Normal file
@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "cmvr/api/speaker_command.proto";
|
||||
|
||||
package cmvr.api;
|
||||
|
||||
service SpeakerService {
|
||||
rpc GetStatus(GetSpeakerStateCommand.Request) returns (GetSpeakerStateCommand.Feedback);
|
||||
rpc PlayAudio(PlayAudioCommand.Request) returns (PlayAudioCommand.Feedback);
|
||||
rpc StreamAudio(stream StreamSpeakerAudioCommand.Request) returns (StreamSpeakerAudioCommand.Feedback);
|
||||
rpc StopPlayback(StopSpeakerCommand.Request) returns (StopSpeakerCommand.Feedback);
|
||||
rpc PausePlayback(PauseSpeakerCommand.Request) returns (PauseSpeakerCommand.Feedback);
|
||||
rpc ResumePlayback(ResumeSpeakerCommand.Request) returns (ResumeSpeakerCommand.Feedback);
|
||||
|
||||
rpc SetVolume(SetSpeakerVolumeCommand.Request) returns (SetSpeakerVolumeCommand.Feedback);
|
||||
rpc GetVolume(GetSpeakerVolumeCommand.Request) returns (GetSpeakerVolumeCommand.Feedback);
|
||||
}
|
||||
@ -37,7 +37,12 @@ import Camera from './camera/index.vue'
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import autofit from 'autofit.js'
|
||||
autofit.init()
|
||||
autofit.init({
|
||||
designHeight: 1080,
|
||||
designWidth: 1920,
|
||||
renderDom: '#app',
|
||||
resize: true
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@ -78,12 +83,25 @@ const back = () => {
|
||||
router.back()
|
||||
}
|
||||
|
||||
const resetAutoFit = () => {
|
||||
autofit.destroy() // 销毁旧缩放
|
||||
autofit.init({
|
||||
designHeight: 1080,
|
||||
designWidth: 1920,
|
||||
renderDom: '#app',
|
||||
resize: true
|
||||
})
|
||||
}
|
||||
|
||||
let clockTimer, binaryTimer;
|
||||
onMounted(() => {
|
||||
updateClock();
|
||||
clockTimer = setInterval(updateClock, 1000);
|
||||
animateBinary()
|
||||
binaryTimer = setInterval(animateBinary, 400);
|
||||
|
||||
document.addEventListener('fullscreenchange', resetAutoFit)
|
||||
document.addEventListener('webkitfullscreenchange', resetAutoFit)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
@ -523,7 +523,7 @@ onUnmounted(() => {
|
||||
margin-bottom: 12px;
|
||||
|
||||
.number {
|
||||
width: 180px;
|
||||
width: 170px;
|
||||
border-radius: 5px;
|
||||
padding: 6px;
|
||||
background: $color-background-card;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user