Hello,


I am going through the ardupilot github code, and trying to write a basic code to output the current PWM values for the motors/channels. And I was wondering if I could get some help regarding that.

I am trying to get those values from the UART and "print/output" them through a BeagleBone.

Using something like this - 
uint8_t nchannels = hal.rcin->num_channels();
 
for (uint8_t i=0; i/span>nchannels; i++) 
 
{
 uint16_t v 
= hal.rcin->read(i);
 hal
.uartE->printf("Channel: %d   Output: %d \n",i, v);
 
}
But this doesn't display anything when I try to read from the UART port. Any help regarding this?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    The MAVLink protocol outs the RC OutPut values, you don't need to do it yourself. Just build a MAVLink parser.
  • I'd recommend building the UART_test in /ardupilot/libraries/AP_HAL/examples/UART_test to see if firstly you have the setup correct and that you are indeed getting anything.

    Where is that code you have above live? Are you enabling the uartE? Are you setting correct baud etc...the new codebase has a SerialManager(AP_SerialManager) that you should look at to make sure setup is correct.

    good luck!

    • Thanks for the reply Steve. I did refer to the UAT_test. I seemed to have figured it out by writing to the uartE instead of printing anything. I then just read at the UART from the BeagleBone.

      That does work if I use the write function specified for writing size bytes as per UARTDriver.cpp (AP_HAL_PX4).

      That's the only way it worked for me.

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @_JonMyer: 🚨Attention DeepRacer's including #UndergroundDeepRacer🚨 Check our our LIVE stream that including @IAM_dbro Take a few moments…
Aug 5
DIY Drones via Twitter
RT @MarvelmindMaxim: Extreme precision for 60 swarming robots. #marvelmind #autonomousrobotics #robotics #swarmrobotics #rtls #ips #indoor…
Aug 3
DIY Drones via Twitter
RT @MarvelmindMaxim: Precise (±2cm) tracking for racing boats and autonomous boats. Works outdoor and indoor. #autonomous #AutonomousVehic…
Aug 3
DIY Drones via Twitter
RT @MarvelmindMaxim: Helping PixHawk folks to fly autonomous quadcopters using PX4 and ArduPilot. https://marvelmind.com/drones/ Equally suitab…
Aug 3
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars @donkey_car virtual AI car race is starting in 15 minutes! Watch it live on Twitch https://www.twitch.tv/mossmann3333 htt…
Aug 1
DIY Robocars via Twitter
RT @chr1sa: Don't miss our monthly @DIYRobocars @donkey_car virtual AI car race tomorrow at 10:00am PT live on Twitch. Head-to-head racing…
Jul 31
DIY Robocars via Twitter
RT @sparkfun: Our completed tutorial on building an @NVIDIA Jetson Nano-powered @Sphero RVR gets your bot up and running via teleoperation…
Jul 30
DIY Robocars via Twitter
RT @SmallpixelCar: Freeway test https://t.co/4V5tV9lhIP
Jul 29
DIY Robocars via Twitter
Very small autonomous cars racing, thanks to an overhead camera: https://control.ee.ethz.ch/research/team-projects/autonomous-rc-car-racing.html
Jul 29
DIY Robocars via Twitter
Jul 29
DIY Robocars via Twitter
Jul 29
DIY Robocars via Twitter
RT @chr1sa: Don't miss our virtual AI car race this Saturday! Real developers + virtual cars =🏎️🏎️🏎️ Head-to-head battles with thrills, sp…
Jul 28
DIY Robocars via Twitter
Jul 27
DIY Robocars via Twitter
RT @usashirou1: Jetson nano by Isaac Kaya #jetson https://t.co/Mu1N0CyQkN
Jul 23
DIY Robocars via Twitter
RT @GPUsolution: JetRacer mady by Iflytek company #JetsonNANO #Nvidia https://t.co/MimTymIwge
Jul 23
DIY Robocars via Twitter
RT @openmvcam: I love this: Mega or Mini? Image Classification on the 1MB OpenMV Cam H7 by Ish Ot Jr. in OpenMV, Edge Impulse, Internet of…
Jul 23
More…