How to set communication between Raspberry Pi 4B and pixhawk 6c through CAN Bus
8 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone, I have a question is that I try to build communication Raspberry Pi 4B(OS: Rasbian) and pixhawk 6c through CAN Bus. I already set the all setting included wire, bitrate=500k, etc. And I use the ccandump pn Raspberry to check is there any data, and result show below:

the ID:1F04397B, 0100047B seems the data send from Pixhawk 6c, and ID:123 is I send from Raspberry, so the connection from Raspberry to CAN and from Pixhawk to CAN should be correct. And the problem is how can I to send the data from Raspberry to Pixhawk through CAN?
0 件のコメント
回答 (1 件)
Sreeram
2024 年 12 月 9 日
I understand that you are trying to establish a CAN communication between Pixhawk hardware and Raspberry Pi hardware.
To send data from the Raspberry Pi to the Pixhawk through CAN, consider following these steps, based on the documentation example:
1. Setup Pixhawk CAN Communication: Use the px4demo_CAN_Pixhawk model as a template to configure the Pixhawk for CAN communication.
2. Setup Raspberry Pi CAN Communication: Open the px4demo_CAN_RasPi model. Configure it with the Raspberry Pi's IP address, username, and password. In the Block Parameters of the "CAN Receive" block, select the appropriate CAN interface (e.g., can1 for the CAN A port). Use the "CAN Transmit" block to send data back to the Pixhawk.
3. Deploy the Model: Click "Monitor & Tune" in the "Run on Hardware" section of the Hardware tab in the Simulink Toolstrip to deploy the model.
For detailed instructions, refer to the following documentation on CAN Communication with Pixhawk Using Raspberry Pi:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!