ros asctec_drivers stack

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

ros asctec_drivers stack

Yogi
Hi
We recently got the Pelican quadrotor, and I am trying to figure out how to interact with.

I tried playign with the ros asctec_drivers and I was confused about a few things:

1. when i run the asctec drivers using the command: roslaunch asctec_proc asctec_driver.launch
although i do get the quadrotor status in the asctec_mon node, however I get neverending stream of error messages also which look like this:

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[AutoPilot-1]: started with pid [8567]
process[AsctecProc-2]: started with pid [8575]
[ INFO] [1310403092.428431980]: Creating AutoPilot Interface
[ INFO] [1310403092.467485696]: Initializing serial port...
[ INFO] [1310403092.467751836]: Starting AsctecProc
[ INFO] [1310403092.480610254]: Successfully connected to /dev/ttyUSB0, Baudrate 57600

[ INFO] [1310403092.482211992]: Publishing LL_STATUS data
[ INFO] [1310403092.483186079]: Publishing IMU_CALCDATA data
[ INFO] [1310403092.483218031]: Control Disabled
[ERROR] [1310403092.795496644]:   Unexpected Data: Flushing receive buffer
[ERROR] [1310403092.808786791]:     Error Reading Packet Header: Resource temporarily unavailable
[ERROR] [1310403092.808928489]:     Read (3): ;?
[ERROR] [1310403092.809003484]:   Read failed
[ERROR] [1310403092.835423407]:     Error Reading Packet Header: Resource temporarily unavailable
[ERROR] [1310403092.835498263]:     Read (3): ??
[ERROR] [1310403092.835534067]:   Read failed
[ERROR] [1310403092.933538751]: Timeout: 0 bytes available 3 bytes requested
[ERROR] [1310403092.954336371]:   Unexpected Data: Flushing receive buffer
[ERROR] [1310403092.964756981]:     Error Reading Packet Header: Resource temporarily unavailable
[ERROR] [1310403092.964830510]:     Read (3):
[ERROR] [1310403092.964864269]:   Read failed
..
..
..
does anyone know what is causing it?


2. How can I send waypoints to the pelican using this ros stack? I do not see any topics for it.

Thank you.
-Yogi
Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

IvanDryanovski
Administrator
> 1. when i run the asctec drivers using the command: roslaunch asctec_proc
> asctec_driver.launch
> although i do get the quadrotor status in the asctec_mon node, however I get
> neverending stream of error messages also which look like this:
>
> ROS_MASTER_URI=http://localhost:11311
>
> core service [/rosout] found
> process[AutoPilot-1]: started with pid [8567]
> process[AsctecProc-2]: started with pid [8575]
> [ INFO] [1310403092.428431980]: Creating AutoPilot Interface
> [ INFO] [1310403092.467485696]: Initializing serial port...
> [ INFO] [1310403092.467751836]: Starting AsctecProc
> [ INFO] [1310403092.480610254]: Successfully connected to /dev/ttyUSB0,
> Baudrate 57600
>
> [ INFO] [1310403092.482211992]: Publishing LL_STATUS data
> [ INFO] [1310403092.483186079]: Publishing IMU_CALCDATA data
> [ INFO] [1310403092.483218031]: Control Disabled
> [ERROR] [1310403092.795496644]:   Unexpected Data: Flushing receive buffer
> [ERROR] [1310403092.808786791]:     Error Reading Packet Header: Resource
> temporarily unavailable
> [ERROR] [1310403092.808928489]:     Read (3): ;?
> [ERROR] [1310403092.809003484]:   Read failed
> [ERROR] [1310403092.835423407]:     Error Reading Packet Header: Resource
> temporarily unavailable
> [ERROR] [1310403092.835498263]:     Read (3): ??
> [ERROR] [1310403092.835534067]:   Read failed
> [ERROR] [1310403092.933538751]: Timeout: 0 bytes available 3 bytes requested
> [ERROR] [1310403092.954336371]:   Unexpected Data: Flushing receive buffer
> [ERROR] [1310403092.964756981]:     Error Reading Packet Header: Resource
> temporarily unavailable
> [ERROR] [1310403092.964830510]:     Read (3):
> [ERROR] [1310403092.964864269]:   Read failed

It looks like the driver cannot communicate over the serial port. The
driver is supposed to run on the Pelican Atom board, and the atom
board needs to be connected to the Autopilot over a serial connection,
and the Autopilot needs to be on.

> 2. How can I send waypoints to the pelican using this ros stack? I do not
> see any topics for it.

The driver is a wrapper which passes messages to the autopilot. We
only implemented messages for the structures we use - CTRL_INPUT. If
you need to send waypoints, you can take a look into the source, and
implement passing waypoint messages. It should be similar to the way
CTRL_INPUT messages are passed.

Hope this helps,

Ivan
Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Yogi
Hi
I was trying to run this over XBee on my desktop connected to another Xbee. Should that be a problem?

Serial communication is happening, because in asctec_mon, I do see the status of the quadrotor changing. For example I can see the yaw changing as i turn the pelican, however the updates seem to be very jerky.

Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

IvanDryanovski
Administrator
On Mon, Jul 11, 2011 at 1:47 PM, Yogi [via asctec-users]
<[hidden email]> wrote:
> Hi
> I was trying to run this over XBee on my desktop connected to another Xbee.
> Should that be a problem?

That should be fine

> Serial communication is happening, because in asctec_mon, I do see the
> status of the quadrotor changing. For example I can see the yaw changing as
> i turn the pelican, however the updates seem to be very jerky.

Can you try changing the launch file to use a lower update rate (likr
5Hz) and only poll LL_STATUS? I wonder if the xbee connection is bad.

Ivan
Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Steven Bellens
In reply to this post by Yogi
2011/7/11 Yogi [via asctec-users]
<[hidden email]>:
> Hi
> I was trying to run this over XBee on my desktop connected to another Xbee.
> Should that be a problem?
>
> Serial communication is happening, because in asctec_mon, I do see the
> status of the quadrotor changing. For example I can see the yaw changing as
> i turn the pelican, however the updates seem to be very jerky.

The serial interface has limited update rates when using the XBee
modules, depending on (i) the size of the data stream and (ii) the
fact you use it to only poll for data or combine it with sending
control inputs as well (maximum rate will be lower in this case). If
the error messages you get pop up all the time, this means either
you're serial connection is buggy, or your update rates are too high.
I found that, when they only pop up once in a while, it's not a
problem.

As a reference: I use the XBee communication to send control input
commands (no data polling) at a rate of 100Hz, and I have _almost_ no
data drops.

Regards,

Steven

>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://asctec-users.986163.n3.nabble.com/ros-asctec-drivers-stack-tp3159818p3159919.html
> To start a new topic under asctec-users, email
> [hidden email]
> To unsubscribe from asctec-users, click here.
Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Yogi
In reply to this post by IvanDryanovski
Hi Ivan
thanks for you help so far.

I lowered the update freq to 1 (also set the update interval to 1), and am only enabling  LL_STATUS, so that we get one message per second.

i see the previous messages have disappeared, however i still get


[ERROR] [1310410591.384857815]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410592.389635426]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410593.394921887]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410595.385011373]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410597.384613916]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410598.378243207]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410599.384478322]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410600.387384669]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410601.384378519]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410604.394393926]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410606.387250529]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410608.377218135]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410609.379334627]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410610.384455968]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410612.385626213]:   Unexpected Data: Flushing receive buffer

[ERROR] [1310410613.384760064]:   Unexpected Data: Flushing receive buffer

...


as you can see many of the messages are not being received properly. Some of the messages however do go through, and are parsed correctly by the program.


Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Yogi
FYI,
I fixed the problem by increasing the sleep time in  serial_interface.cpp
-----------------------
 while (bytes_available < bytes_requested)
    {
      ioctl(dev_,FIONREAD,&bytes_available);
      usleep(10); //changing from 1 to 10 seems to fix timeout issues -- Yogi
      if (i>650 && bytes_available < bytes_requested)
      {
        ROS_ERROR("Timeout: %d bytes available %d bytes requested",bytes_available,bytes_requested);
        return bytes_available;
      }
      i++;
    }

-----------------------

thank you for your help.
Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Steven Bellens
2011/7/12 Yogi [via asctec-users]
<[hidden email]>:

> FYI,
> I fixed the problem by increasing the sleep time in  serial_interface.cpp
> -----------------------
>  while (bytes_available < bytes_requested)
>     {
>       ioctl(dev_,FIONREAD,&bytes_available);
>       usleep(10); //changing from 1 to 10 seems to fix timeout issues --
> Yogi
>       if (i>650 && bytes_available < bytes_requested)
>       {
>         ROS_ERROR("Timeout: %d bytes available %d bytes
> requested",bytes_available,bytes_requested);
>         return bytes_available;
>       }
>       i++;
>     }
>
> -----------------------
>
> thank you for your help.

Looks like an important fix to me. Did you test it with various update rates?

Steven

>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://asctec-users.986163.n3.nabble.com/ros-asctec-drivers-stack-tp3159818p3160624.html
> To start a new topic under asctec-users, email
> [hidden email]
> To unsubscribe from asctec-users, click here.
Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Yogi
I spoke to soon.
Although increasing the timeout does remove some of the problems, I still get tons of


[ERROR] [1310482554.909771865]:   Unexpected Data: Flushing receive buffer

I tried to see what was this data which was still left, and it seems like its another packet.
The packet descriptor seems to be 0x31 and the struct size is 39. This packet is not described
in the manual. Does anyone know what this packet is?

Thank you.

-Yogi
Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Bill Morris
Administrator
On Tue, 2011-07-12 at 08:02 -0700, Yogi [via asctec-users] wrote:

> I spoke to soon.
> Although increasing the timeout does remove some of the problems, I
> still get tons of
>
>
> [ERROR] [1310482554.909771865]:   Unexpected Data: Flushing receive
> buffer
>
> I tried to see what was this data which was still left, and it seems
> like its another packet.
> The packet descriptor seems to be 0x31 and the struct size is 39. This
> packet is not described
> in the manual. Does anyone know what this packet is?

It sounds like you might be getting a lot of radio interference.
Have you tried connecting directly instead of using the xbee?

Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Yogi
Hi Bill
I see this packet even when I am not using Xbee.
It seems at least one other user has had this problem:

http://asctec-users.986163.n3.nabble.com/Throttling-non-flying-Pelican-throws-off-my-program-tp2732771p2754109.html

I actualyl wrote my own standalone C++ program which sends a simple polling request for LL_STATUS message and reads the reply..
Even in this simple program I am seeing this packet being sent. So its not the ros module, and somethign to do with the pelican iteself

Reply | Threaded
Open this post in threaded view
|

Re: ros asctec_drivers stack

Rafa
Hi Yogi,

I try to write a standalone C++ program to read the IMU_RAWDATA and IMU_CALCDATA, but all i tried doesn't work. How did you write your programm? Maybe you can tell me how to do it or post the code?

thanks a lot!