Closed vladinator1000 closed 5 years ago
Hi savovs,
Glad to hear the library is working out.
I'm assuming you're using the C++ library. The CompUpdate function is a "void" function, so it won't return any values. In order to get the angles relative to ground, the function CompAnglesGet is used. Pass the addresses of two float type variables to the function to get the values out. Then, those variables can be de-referenced via use of a pointer to grab the values which will be expressed as radians. Those values can then be converted to degrees by using the CompRadiansToDegrees function.
Hopefully, this will get you in the right direction.
On Tue, Apr 12, 2016 at 6:37 PM, savovs notifications@github.com wrote:
I noticed that the compUpdate function doesn't really return any values. I need to use those comp. angles so I thought it could be a good idea to make them public. (by the way, the library runs marvellously well
on Arduino using the Sparkfun LSM6DS3 sensor)
You can view, comment on, or merge this pull request online at:
https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2 Commit Summary
- Made the compAngle variables public so they can be read.
File Changes
- M C++/six_axis_comp_filter.h https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2/files#diff-0 (13)
Patch Links:
- https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2.patch
- https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2
-Trent Cleghorn
Scratch that on the dereferencing with a pointer part. I'm still stuck in C mode with all of its use of pointers to do stuff. On Apr 12, 2016 8:03 PM, "Trent Cleghorn" trentoncleghorn@gmail.com wrote:
Hi savovs,
Glad to hear the library is working out.
I'm assuming you're using the C++ library. The CompUpdate function is a "void" function, so it won't return any values. In order to get the angles relative to ground, the function CompAnglesGet is used. Pass the addresses of two float type variables to the function to get the values out. Then, those variables can be de-referenced via use of a pointer to grab the values which will be expressed as radians. Those values can then be converted to degrees by using the CompRadiansToDegrees function.
Hopefully, this will get you in the right direction.
On Tue, Apr 12, 2016 at 6:37 PM, savovs notifications@github.com wrote:
I noticed that the compUpdate function doesn't really return any values. I need to use those comp. angles so I thought it could be a good idea to make them public. (by the way, the library runs marvellously well
on Arduino using the Sparkfun LSM6DS3 sensor)
You can view, comment on, or merge this pull request online at:
https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2 Commit Summary
- Made the compAngle variables public so they can be read.
File Changes
- M C++/six_axis_comp_filter.h https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2/files#diff-0 (13)
Patch Links:
- https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2.patch
- https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2
-Trent Cleghorn
Would you do this like that?:
float angle1, angle2; CompSixAxis.CompAnglesGet(&angle1, &angle2);
I've never really done pointers before...
Edit: Yup, it works!
Right. That would work. Then, the values will get stored in those variables by the function CompAnglesGet.
On Wed, Apr 13, 2016 at 3:24 PM, savovs notifications@github.com wrote:
Would you do this like that?: float angle1, angle2; CompSixAxis.CompAnglesGet(&angle1, &angle2)
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2#issuecomment-209631480
-Trent Cleghorn
Hi Trent,
Can I contact you please?
I need help interfacing the tiva c launchpad with mpu6050 using your library.
Are you on facebook? or any other social media.
Many Thanks.
Contacting me here on GitHub will work just fine. Besides, someone else may be aided in the discussion. On Jun 10, 2016 2:55 PM, "isso11" notifications@github.com wrote:
Hi Trent, Can I contact you please? I need help interfacing the tiva c launchpad with mpu6050 using your library.
Are you on facebook? or any other social media. Many Thanks.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tcleg/Six_Axis_Complementary_Filter/pull/2#issuecomment-225280032, or mute the thread https://github.com/notifications/unsubscribe/AGUaKW8aNtYyvqBUKIj9ZdXmA7PjvQFwks5qKcE-gaJpZM4IF7Fn .
Thank you. Your lib is a light source to me since I have been searching for it for long. I do appreciate your help. It's just that I'm not sure about the sequence of the functions in your lib.
(2) I should now follow the functions in your lib, but would you please show me a brief guide on the sequence of using these functions. which one first and then next until I get the filtered angles. I have tried but failed to get promising output.
and how should I calculate deltaT , tau, and omega.?
That was my attempt to utilize your lib, but the readings are not realistic and YAngle is almost always zero. Please see if I didn't utilize it well.
CompInit(&filter, 0.0025, 2); //values set randomly just as a trial
while (1)
{
CompAccelUpdate( acc recent readings m/s^2);
CompStart(&filter);
CompGyroUpdate(gyro recent readings deg/s);
CompUpdate(&filter);
CompAnglesGet(&XAngle,&YAngle);
}
Best Regards,
Hey @isso11 this gist should help. @tcleg do you think the README would benefit from this? :)
I noticed that the compUpdate function doesn't really return any values. I need to use those comp. angles so I thought it could be a good idea to make them public. (by the way, the library runs marvellously well on Arduino using the Sparkfun LSM6DS3 sensor)