Can we control a real robot using ROS(Robot operating system) with simulink or MATLAB Image processing Coding. If it is possible what is the flow of interconnection between these entities ?
이전 댓글 표시
What should be the flow of interconnection between entities to control a Real Robot using ROS(Robot operating system)and simulink.
답변 (1개)
Cam Salzberger
2018년 1월 30일
1 개 추천
Hello Sajid,
I am assuming that your desired result is to have your robot publishing images from a camera, MATLAB or Simulink receiving the images, and then some other MATLAB code or Simulink blocks processing the images. If that is correct, then the usual way to do this is quite simple.
ROS steps:
- Set up a ROS node on your robot that gathers the images from your camera in whichever manner you desire.
- Create a publisher for that node, publishing messages containing the images on your chosen topic name. I'd recommend sensor_msgs/Image or sensor_msgs/CompressedImage for simplicity of extraction later.
- Start the node publishing to make testing things easier later.
If you want your image processing code in MATLAB:
- Create a function that does the desired image processing. Make it accept the ROS message as input, and you can use readImage to extract the image from the message.
- Code up a rossubscriber to that topic.
- Make the image processing function the callback for the subscriber.
- If you started the ROS master outside of MATLAB, connect to it with rosinit.
- Run your subscriber code.
If you want your image processing to be done in Simulink:
- Specify the correct network connection settings for connecting to the ROS network.
- Add a Subscribe block to your model, setting the properties appropriately to handle the correct topic and message type.
- Connect the output to your desired image processing functionality.
- (Optional) If you only want to call your image processing functionality when you receive a new message (likely), then put it all in a Triggered Subsystem, setting the IsNew output of the Subscribe block to be the trigger.
- Run the model.
-Cam
댓글 수: 2
sajid javid
2018년 3월 3일
HieuKuteVN18
2025년 12월 17일
Dear Mr Cam I am now a uni student ,and i have a subject project about using Matlab to control real Yaskawa robot GP4,yrc1000micro.You can explain how i can start pls.Tks so much !
카테고리
도움말 센터 및 File Exchange에서 Get Started with ROS Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!