StanfordASL / safe_traffic_weaving

On Infusing Reachability-Based Safety Assurance within Probabilistic Planning Frameworks for Human-Robot Vehicle Interactions
Other
16 stars 5 forks source link

Connection between ROS and Microautobox #2

Open Hellesbier opened 5 years ago

Hellesbier commented 5 years ago

Hi,

now i am searching some information about connection between ROS and Microautobox.

I have a plan, that driving motion regulation of Matlab/Simulink works on Microautobox. But the regulation should get date of trajectorie from ROS. For it, i would use UDP/IP connection between ROS and Mircoautobox.

What kind of Interface did you used for it? Did you make yourself own connection between ROS and Microautobox?

It will be very helpful, if you give me tip of your experience.

My email is dusdlswh@gmail.com.

Thanks in advance. Best regards. Chunghyun Lyu

Hellesbier commented 5 years ago

Hi, please ignore the previous comment.

now i will explain our system architecture.

  1. Control algorithms (longitudinal and lateral dynamics control) are displayed on a host PC(Laptop with windows and no ROS) in Matlab / Simulink.
  2. This model is then compiled and flashed on the microautobox (we already have Microautobox ll 1401/1511) through the Simulink-Coder and RTI interface of DSpace.
  3. The Microautobox will be connected by a second cable (UDP / IP Ethernet) to the main PC, which will be installed in the vehicle.
  4. The Microautobox is then communicated to a node of the ROS of Main-PC, during exchanging interactively the setpoint values ​​of ROS and actual values ​​of Microautobox.

I have the following questions now.

  1. In the third step, how can the connection (protocol) between ROS (Main-PC) and Microautobox (already flattened control algorithms) be established by UDP / IP Ethernet? If it is still unknown, what is the actual protocol process in between?
  2. If the first question is answered, how can you program the protocol in real time?
  3. At the fourth step, what content and which language of the data packet of ROS nodes should have for the protocol? Based on the second step, the control algorithms determined by Simulink coders are overwritten with C on the Microautobox. But ROS is written with C ++. Here I am very confused how the data packets are compiled by ROS.

I am sorry to you if I have asked stupid questions. I am a newbee on ROS.

Thanks in Advance. Best Regards, Chunghyun Lyu

nspo commented 4 years ago

If you still have this issue, you can have a look at microbuf - a data serialization toolchain for C++ and embedded systems with MATLAB support. With microbuf, you can generate a serialization header for C++ and a MATLAB deserialization function which you can use in the MicroAutoBox model.