Skip to content

Class Diagram

Bugeon Kim edited this page Apr 6, 2026 · 60 revisions

APP

  • 공통 모듈 구조
classDiagram
    namespace c {
        class task{
            run()
            step()        
        }
    }

    class service{
      comm::communication* comm
      hal::hardware* hardware
      serve()
    }

    namespace comm {
        class communication{
            <<interface>>
        init()
        send()
        receive()
        }
    }

    namespace hal {
        class hardware{
            <<interface>>
        read()
        write()
        }
    }
    
    communication --* service
    hardware --* service
    service <-- task
Loading

ACT

classDiagram
    namespace c {
        class send_status_task{
            get_enum()
            run()
            step()
        }
        class check_function_task{
            get_enum()
            run()
            step()
        }
    }

    class service{
      comm::communication* comm
      hal::hardware* hardware
      check_act_info()
      send_act_info()
      

            
    }

      class service2{
      comm::communication* comm
      hal::hardware* hardware
      
      check_act_info()
      send_theta()
      reboot()
      
    }

    namespace comm {
        class communication{
            <<interface>>
        init()
        send()
        receive()
        }
    }

    namespace hal {
        class hardware{
            <<interface>>
        read()
        write()
        }
    }
    
    service2 <-- check_function_task
    communication --* service
    hardware --* service
    service <-- send_status_task
    hardware --* service2
    communication --* service2
Loading

GCU

classDiagram
    namespace c {
        class status_task{
            부체계 괜찮은지 확인
            run()
            step()        
        }
        class command_task{
            명령 처리
            run()
            step()        
        }
        class telemetry_task{
            ui에 보고
            run()
            step()        
        }
    }

    class service{
      comm::communication* ui_comm
      comm::communication* subsystem_comm
      hal::hardware* hardware
      reboot_gcu()
      reboot_subsystem()
      function_check()
      send_status()
    }

    namespace comm {
        class communication{
            <<interface>>
        init()
        send()
        receive()
        }
    }

    namespace hal {
    }
    
    communication --* service
    hardware --* service
    service <-- status_task
    service <-- command_task
    service <-- telemetry_task
Loading

IMU

SKR

classDiagram
    namespace c {
        class status_task {
            serve_status() %% 1000ms 주기 실행
        }
        class check_task {
            serve_check()  %% 명령 수신 시 실행
        }
        class reboot_task {
            serve_reboot() %% 인터럽트 수신 시 실행
        }
    }

    class skr_service {
        -comm::i_comm* comm
        -hal::i_hardware* hardware
        +serve_status()
        +serve_check()
        +serve_reboot()
    }

    namespace comm {
        class i_comm {
            <<interface>>
            +send()
            +receive()
        }
    }

    namespace hal {
        class i_hardware {
            <<interface>>
            +get_mcu_voltage()
            +get_cpu_temp()
            +get_cpu_usage()
            +get_ram_usage()
            +get_heap_usage()
            
            +get_ir_data()
            +calculate_dist()
            +system_reset()
        }
    }

    %% 관계 설정 (합성)
    i_comm --* skr_service
    i_hardware --* skr_service
    
    %% 관계 설정 (의존)
    skr_service <-- status_task
    skr_service <-- check_task
    skr_service <-- reboot_task
Loading

COMM

FSM

ACT

GCU

IMU

SKR

ICD(DTO)

  • 전송 데이터 형식

common

classDiagram
    class common_parameter{
      uint16_t message_id
      uint8_t mcu_voltage
      uint8_t cpu_temperature
      uint8_t cpu_usage
      uint8_t ram_usage
      uint8_t heap_usage
    }

    class feature_inspect_finish_res {
        uint16_t message_id
    }

    class feature_inspect_finish_command{
        uint16_t message_id
    }

    class feature_inspect_result{
        uint16_t message_id
        uint32_t count
    }

    class reboot_command {
        uint16_t message_id
        subsystem target
    }
Loading

ACT

classDiagram
   class act_info{
    uint16_t message_id
    uint8_t act_status
    int32_t a_motor_theta
    int32_t a_motor_omega
    int32_t b_motor_theta
    int32_t b_motor_omega
    
   }

   class pin_control_res{
    uint16_t message_id
   }

   class pin_control_req{
    uint16_t message_id
    int32_t a_motor_theta
    int32_t b_motor_theta
   }
Loading

GCU

classDiagram
    class full_system_info{
      uint16_t message_id
      gcu_status gcu_status
      common_parameter common_parameter
      act_info act_info
      imu_info imu_info
      skr_info skr_info
    }
    class target_distance_req{
        uint16_t message_id
    }
    class position_req{
        uint16_t message_id
    }
    class feature_inspect_result{
        uint16_t message_id
   	target_distance_req target_distance_req
	position_res position_res
	pin_control_req pin_control_req
	uint32_t algorithm_time
	uint32_t act_comm_time
	uint32_t imu_comm_time
	uint32_t skr_comm_time
    }
Loading

IMU

classDiagram
    class imu_data {
        int16_t message_id
        int32_t latitude
        int32_t longitude
        int32_t altitude
        int16_t yaw
        int16_t pitch
        int16_t roll
    }
    class imu_info {
        uint16_t message_id  
        imu_status status    
        imu_data data        
    }
    class position_req {
        uint16_t message_id 
    }
    class position_res {
        uint16_t message_id 
        imu_data data        
    }
Loading

SKR

classDiagram
    SKR_info          
    SRK_info : uint16_t message_id
    SRK_info : skr_status status
    SRK_info : common-parameter com_param    
    
    SRK_dist
    SRK_dist : uint16_t message_id
    SRK_dist : int16_t srk_dist
Loading

UI

classDiagram
    class feature_inspect_command {
        uint16_t message_id
        uint32_t loop_count
    }
Loading

Clone this wiki locally