Skip to content

Conversation

Laeyoung
Copy link

@Laeyoung Laeyoung commented Apr 8, 2024

add play_dot_mode() and play_path_mode()

@Laeyoung Laeyoung requested a review from westside April 8, 2024 05:14
sample.py Outdated
sdk_instance.play_event("shoot_test", duration=2)
time.sleep(0.2)
sdk_instance.stop_all()
sdk_instance.play_path_mode(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westside 상원님
path mode를 이렇게 불렀는데, 원하는대로 작동이 안되고 이상한 dot mode처럼 작동을 하는데요. (Android에서 구현해주신 것 보고 추측하면서 호출했습니다.) 한번 봐주실 수 있을까요?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

방금 테스트해보니 잘 적용된 느낌입니다.
dot모드와 다른건, 가상의 point를 울리게 하다는 것만 달아서 dot mode처럼 동작한다고 느끼실 수 있을 것 같습니다.

            x_list = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]

            for i in x_list:
                sdk_instance.play_path_mode(
                    x_list=[i],
                    y_list=[0.5],
                    intensity_list=[5],
                    duration=1
                )
                time.sleep(0.5)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위에 코드처럼 보내야 되는군요?
그러면 sample.py를 남겨주신 comment의 코드로 변경해 놓겠습니다.

Copy link
Contributor

@westside westside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다. 잘 되는 거 같은데요?
x_list = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]로 하고,
requestId를 고정하시면 돌아가는 느낌을 받으실 수 있습니다.

    def play_path_mode(self, x_list, y_list, intensity_list, pos=0, duration=1):
        """Play an dot mode event."""
        if self.client is None:
            return -1

        request_id = 100
        play_message = {
            "requestId": request_id,
            "pos": pos,
            "durationMillis": duration * 1000,
            "x": x_list,
            "y": y_list,
            "intensity": intensity_list
        }

        message = generate_message("SdkPlayPathMode", play_message)
        self.client.send_message(message)

        return request_id

@Laeyoung
Copy link
Author

Laeyoung commented Apr 9, 2024

말씀해주신대로 내용 업데이트하고 주석이라 로그도 추가했습니다.

Merge 하겠습니다.

@Laeyoung Laeyoung merged commit 5fe060a into feat/tacthub Apr 9, 2024
@Laeyoung Laeyoung deleted the feat/dot-and-path-mode branch April 9, 2024 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants