MotionScoreServer Documentation
MotionScoreServer 는 C++로 작성된 간단한 HTTP 서버로, 오버레이 제어와 운동 시작/종료 요청을 처리합니다.
빌드된 실행 파일인 MotionScoreServer 를 실행하면 서버가 자동으로 포트 8080 에서 시작됩니다.
Endpoint : /overlay_on
Method : POST
Request Body (JSON) :
{
"x" : 100 ,
"y" : 100 ,
"width" : 100 ,
"height" : 100
}
curl -X POST http://localhost:8080/overlay_on -H " Content-Type: application/json" -d ' {"x":100,"y":100,"width":100,"height":100}'
curl http://localhost:8080/overlay_off
Endpoint : /exercise_start
Method : POST
Request Body (JSON) :
curl -X POST http://localhost:8080/exercise_start -H " Content-Type: application/json" -d ' {"exercise_code":427}'
Endpoint : /exercise_end
Method : GET
Response : 운동 종료가 성공하면 아래와 같은 JSON 형식의 결과가 반환됩니다.
{
"exercise_code" : 427 ,
"score" : 4.5 ,
"features" : {
"vertical_arm" : 2.3 ,
"horizontal_arm" : 3.4
}
}
curl http://localhost:8080/exercise_end
Endpoint : /session_start
Method : POST
Request Body (JSON) :
{
// Session can be 'advanced' or 'simple'
"type" : " advanced"
}
curl -X POST http://localhost:8080/session_start -H " Content-Type: application/json" -d ' {"type":"advanced"}'
Endpoint : /session_end
Method : GET
Response : 세션 종료가 성공하면 아래와 같은 JSON 형식의 결과가 반환됩니다.
[
{
"exercise_code" : 427 ,
"timestamp" : 1744469659318 ,
"features" : {
"LeftShoulderForwardAngle" : 0.356337 ,
"LeftShoulderUpperAngle" : 0.162778 ,
"LeftShoulderSideAngle" : 0.923694 ,
"RightShoulderForwardAngle" : 0.908989 ,
"RightShoulderUpperAngle" : 0.133905 ,
"RightShoulderSideAngle" : 0.78038 ,
},
"score" : 3 ,
"score by AI" : 3.00376 ,
},
{
"exercise_code" : 428 ,
"timestamp" : 1744469676088 ,
"features" : {
"LeftRaise" : 0.590652 ,
"RightRaise" : 0.582238 ,
},
"score" : 9 ,
"score by AI" : 8.71698 ,
},
{
"exercise_code" : 429 ,
"timestamp" : 1744469687062 ,
"features" : {
"LeftStand" : 0 ,
"RightStand" : 0.00776667 ,
},
"score" : 0 ,
"score by AI" : -0.103938 ,
},
{
"exercise_code" : 430 ,
"timestamp" : 1744469701259 ,
"features" : {
"AverageLeftKnee" : nan,
"AverageRightKnee" : nan,
"AverageLeftAnkle" : nan,
"AverageRightAnkle" : nan,
"StdevLeftKnee" : nan,
"StdevRightKnee" : nan,
"StdevLeftAnkle" : nan,
"StdevRightAnkle" : nan,
},
"score" : 0 ,
"score by AI" : nan,
},
{
"exercise_code" : 431 ,
"timestamp" : 1744469728759 ,
"features" : {
"StraightStand" : 0.897061 ,
"BentStand" : -0.0316793 ,
"BentSit" : -0.131609 ,
},
"score" : 2 ,
"score by AI" : 1.67412 ,
},
{
"exercise_code" : 432 ,
"timestamp" : 1744469728759 ,
"features" : {
"LeftThighRaise" : 0.2 ,
"RightThighRaise" : 0.2 ,
"LeftCalfRaise" : 0.2 ,
"RightCalfRaise" : 0.2 ,
},
"score" : 2 ,
"score by AI" : 0 ,
},
{
"exercise_code" : 433 ,
"timestamp" : 1744469728759 ,
"features" : {
"LeftArmHorizontal" : 0.2 ,
"RightArmHorizontal" : 0.2 ,
"LeftLegHorizontal" : 0.2 ,
"RightLegHorizontal" : 0.2 ,
"LeftArmVertical" : 0.2 ,
"RightArmVertical" : 0.2 ,
"LeftLegVertical" : 0.2 ,
"RightLegVertical" : 0.2 ,
},
"score" : 2 ,
"score by AI" : 0 ,
},
{
"exercise_code" : 434 ,
"timestamp" : 1744469728759 ,
"features" : {
"LeftArm" : 0.2 ,
"RightArm" : 0.2 ,
"LeftLeg" : 0.2 ,
"RightLeg" : 0.2 ,
},
"score" : 2 ,
"score by AI" : 0 ,
},
]
curl http://localhost:8080/session_end