[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] segmentation fault because of sin()



Mohsen Mahvash Mohammadi wrote:

> Hi
> I have found that using sin() and cos() in real time task has caused
> segmentation fault for user program.here is part of my program which
> causes the problem:
>
> #include <math.h>
>
>  float theta1_rad;
>  float theta2_rad;
> ...
> ...
>   theta2_rad = 0.0;/*for test*/
> theta1_rad = 0.0;/*for test*/
> pencat_pos.y = Link1 * sin(theta1_rad) - Link2 * cos(theta2_rad) ;
>
> Do you know how I can fix this problem

I'm not an expert. But did you configure RTLinux with floating point support?

--Gordon