aeyrium / aeyrium-sensor Goto Github PK
View Code? Open in Web Editor NEWA Flutter sensor plugin which provide easy access to the Pitch and Roll on Android and iOS devices.
Home Page: https://aeyrium.com
License: MIT License
A Flutter sensor plugin which provide easy access to the Pitch and Roll on Android and iOS devices.
Home Page: https://aeyrium.com
License: MIT License
Could you make the values for roll the same?
The Attitude indicator screen. I want to look at the source code and learn how to implement it.
Hi,
Great package but I'm seeing mixed results with cancelling the stream. I'm recording actions and my app grabs the pitch and roll at the start of a record session, then records events and deducts this first event from each record. I do this because the phone could be at any angle to start with and it needs to be normalised. So grabbing a first value of pitch and roll is vital, and hence I need the stream to close so it doesn't keep updating this value. I use:
_vectorStream = AeyriumSensor.sensorEvents.listen(
(SensorEvent event) {
if (event.pitch != null) {
_sensorVectorOffset = Vector(event.pitch, event.roll);
_vectorStream.cancel();
}
},
);
Usually this works for the first four or five attempts and then after that it no longer closes the stream, and starts overriding this offset value.
Can you please advise what the issue is and how to close your stream consistently?
Luke
It'd be lovely to have.
I have used this library on android (emulator and real device without any problems), however on the iPhone 8 (physical device) the roll sensor value jumps from 0 to approximately 2*pi or 6.28... when the phone lays flat.
Whereas on android it changes from 1 to 0 to -1 for example, when i rotate the device.
I think, the library should give consistent results on android and iOS.
I would prefer it the android way. In the meantime I use this workaraound:
if(Platform.isIOS){
if(event.roll < (-1)*pi){
sensorValue = 2*pi+event.roll;
}
else{
sensorValue = event.roll;
}
}
else{
sensorValue = event.roll; //roll in radians for android
}
Awesome-Flutter is the main curated resources list for Flutter
Would you like to join ?
Thank you.
It would be great if azimuth could be added.
Hi,
I've copied the example , then at the moment to run shows nothing on device!!
on my debug console says : E/SensorManager( 2627): sensor or listener is null
Can you help me with this, please?
The plugin aeyrium_sensor uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.