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
yesterday
DIY Robocars via Twitter
RT @NVIDIADRIVE: Season Beta has arrived! Check out the first race of the @roborace season, livestreaming from Anglesey Circuit Sept. 24-26…
yesterday
DIY Robocars via Twitter
RT @IndyAChallenge: Here is the ROS-based small-scale vehicle platform showing the ROS Visualization (Rviz) screen with multiple ROS nodes…
Tuesday
DIY Robocars via Twitter
RT @IndyAChallenge: Here is Black & Gold Autonomous Racing's simulated racecar running a lap @IMS and showing the team's code overtaking ot…
Tuesday
DIY Robocars via Twitter
Tuesday
DIY Robocars via Twitter
RT @donkey_car: New Maintainers! Donkey Car 4.0 and more! Here is our September Newsletter! https://donkeycar.substack.com/p/september-donkey-newsletter?r=2ji2t&utm_campaign=post&utm_medium=web&utm_source=copy
Tuesday
DIY Robocars via Twitter
RT @chr1sa: Kinda cool that we just hit 2,500 members of our Bay Area self-driving car racing league. More than 10k globally. Fast, cheap…
Tuesday
DIY Robocars via Twitter
RT @chr1sa: Our next @DIYRobocars virtual AI car race is next Saturday. Compete from home using the @donkey_car simulator -- no physical ca…
Sunday
DIY Robocars via Twitter
RT @RoboticMasters: Students from @Sydney_Uni working hard on improvements and changes to @donkey_car simulator. @diyrobocars @adafruit…
Sunday
DIY Robocars via Twitter
Practice virtual race this Saturday; the real thing will be on Oct 3 https://www.meetup.com/DIYRobocars/
Sep 23
DIY Robocars via Twitter
Sep 23
Derrick Davies liked lisa TDrones's profile
Sep 23
DIY Robocars via Twitter
Sep 21
DIY Robocars via Twitter
RT @SahikaGenc: AWS DeepRacer & Hot Wheels Track https://youtu.be/4H0Ei07RdR4 via @YouTube
Sep 14
DIY Robocars via Twitter
Sep 8
DIY Robocars via Twitter
RT @davsca1: We are releasing the code of our Fisher Information Field, the first dedicated map for perception-aware planning that is >10x…
Sep 8
More…