Ros Raspberry Arduino Due Serial Communication ?

조회 수: 2 (최근 30일)
Hocine YAKOUBI
Hocine YAKOUBI 2022년 9월 26일
편집: Hocine YAKOUBI 2022년 10월 15일
Hi,
I am using Raspi Pi4 and Arduino Due with serial communication.
I can send command from Raspi to Dc motor in Arduino and receieve sensor Data from Arduino to Raspi.
I am also using another program to work with Ros in Raspi, also it works fine.
Now, the aim is to use the Data aquired from sensor in Arduino Due (Data that are in Serial com in Raspi),
in Raspi to share that in Ros Noeud.
I get the error in puicture in attachement.
Could someone help to reslve that ?
Many thanks by advance.
  댓글 수: 7
Prasanth Sunkara
Prasanth Sunkara 2022년 10월 14일
Could you please try updating the "/etc/environment" file on Pi as shown below?
1) Go to Pi's terminal
2) sudo nano /etc/environment
3) Add the below code to the end of that file.
MW_ROSDISTRO=melodic
Note: if you have installed a different version of ROS, instead of melodic, please update the above line accordingly.
Ideally, ROS would get installed at /etc/ros/<version>
Please give it a try
Thanks,
Prasanth
Hocine YAKOUBI
Hocine YAKOUBI 2022년 10월 15일
편집: Hocine YAKOUBI 2022년 10월 15일
Thanks your answer.
My problem not come from Ros itself, because I can deploy Ros programm on my Pi4.(MW_ROSDISTRO=melodic is set correctly because I used Mathworks image for Raspi Os).
The problem come when I connect my serial read block to bus assigment,see picture in attachement withouth connecting the delpoy work and no problem.
The solution would be a serial decoder or deserilize block to send Data from serial Block to publish block !!
So, the question is : what block should I use de link serial block to ros publish block ?
Thanks again

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by