Main Content

MATLAB에서의 ROS 2 네트워크 액세스

MATLAB®을 사용해 ROS 2 네트워크와 메시지에 액세스

ROS 2는 메시지를 사용하여 정보를 공유합니다. 메시지는 데이터 공유를 위한 간단한 데이터 구조입니다. 메시지를 받거나 서브스크라이브하려면 ros2subscriber를 사용합니다. 메시지를 보내거나 퍼블리시하려면 ros2publisher를 사용합니다. 메시지 전송에 대한 자세한 내용은 ROS 2 Publisher 및 ROS 2 Subscriber를 사용해 데이터 교환하기 항목을 참조하십시오.

ROS 2 서비스 및 액션을 통해 사용자는 작업을 수행할 수 있습니다. ROS 2 서비스는 요청-응답 통신을 통해 정보를 수집하고 ROS 2 네트워크에서 콜백 함수를 트리거합니다. 액션은 작업이나 목표를 트리거하고 작업을 실행하는 동안 피드백을 받는 데 사용할 수 있습니다.

함수

모두 확장

ros2messageROS 2 메시지 구조체 생성 (R2019b 이후)
ros2ROS 2 네트워크 정보 가져오기 (R2019b 이후)
rosShowDetailsDisplay all ROS message contents (R2021a 이후)
ros2publisherPublish messages on a topic (R2019b 이후)
send토픽에 ROS 2 메시지 퍼블리시 (R2019b 이후)
ros2subscriberSubscribe to messages on a topic (R2019b 이후)
receiveWait for new message (R2019b 이후)
ros2messageROS 2 메시지 구조체 생성 (R2019b 이후)
callCall ROS or ROS 2 service server and receive a response (R2019b 이후)
isServerAvailableDetermine if ROS or ROS 2 service server is available (R2021b 이후)
ros2ROS 2 네트워크 정보 가져오기 (R2019b 이후)
ros2svcclientConnect to ROS 2 service server (R2021b 이후)
ros2svcserverCreate ROS 2 service server (R2021b 이후)
waitForServerWait for ROS or ROS 2 service server to start (R2021b 이후)

ROS 2 액션 서버

ros2actionserverCreate ROS 2 Action Server (R2023b 이후)
getFeedbackMessageCreate new ROS 2 action feedback message (R2023b 이후)
handleGoalResponseAccept or reject new ROS 2 action goal and send status (R2023b 이후)
isPreemptRequestedCheck if a goal has been preempted (R2023b 이후)
sendFeedbackSend feedback to ROS 2 action client during goal execution (R2023b 이후)

ROS 2 액션 클라이언트

ros2actionclientCreate ROS 2 action client (R2023a 이후)
waitForServerWait for ROS 2 action server to be ready for sending goals (R2023a 이후)
sendGoalSend goal message to ROS 2 action server (R2023a 이후)
getStatusGet execution status of specific goal sent by ROS 2 action client (R2023a 이후)
ros2ActionSendGoalOptionsReturn structure for ROS 2 action client callback (R2023a 이후)
cancelGoalCancel specific goal sent by ROS 2 action client (R2023a 이후)
cancelGoalAndWaitCancel specific goal sent by ROS 2 action client and wait for cancel response (R2023a 이후)
cancelGoalsBeforeCancel goals sent by ROS 2 action client before timestamp (R2023a 이후)
cancelGoalsBeforeAndWaitCancel goals sent by ROS 2 action client before timestamp and wait for cancel response (R2023a 이후)
cancelAllGoalsCancel all active goals sent by ROS 2 action client (R2023a 이후)
cancelAllGoalsAndWaitCancel all active goals sent by ROS 2 action client and wait for cancel response (R2023a 이후)

ROS 2 액션 목표 핸들

ActionClientGoalHandleGoal handle object for ROS 2 action client goals (R2023a 이후)
getResultGet result of specific goal associated with goal handle (R2023a 이후)

블록

모두 확장

Blank Message지정된 메시지 유형을 사용해 빈 ROS 2 메시지 생성 (R2019b 이후)
PublishSend messages to ROS 2 network (R2019b 이후)
SubscribeReceive messages from ROS 2 network (R2019b 이후)
Call ServiceCall service in ROS 2 network (R2021b 이후)

도움말 항목

ROS 2 Publisher 및 Subscriber

ROS 2 서비스

  • Call and Provide ROS 2 Services
    Set up service servers to advertise a service to the ROS network. In addition, you will learn how to use service clients to call the server and receive a response.