Comments (6)
Hi, this feature isn't implemented yet. Actually navigation arrrow is centered at screen and map changes. I don't know when this feature will be available...
Isn't easy to implement this feature, but it's interesting , maybe in future version I'll implement it
from icenav-v3.
ok,i will have a try.
from icenav-v3.
how can the maps retotate with the mpu9250 module? where is the related code of the maps retotate with the mpu9250?
I want to change the rule, that is to say, the maps remains silent and the arrow retotate according to the mpu9250.
For example, i turn right, the arrow turns right, i turn left , the arrow turns left.
waiting for you replay.
from icenav-v3.
static void update_map(lv_event_t *event)
{
CurrentMapTile = get_map_tile(getLon(), getLat(), zoom, 0, 0);
if (strcmp(CurrentMapTile.file, OldMapTile.file) != 0 || CurrentMapTile.zoom != OldMapTile.zoom ||
CurrentMapTile.tilex != OldMapTile.tilex || CurrentMapTile.tiley != OldMapTile.tiley)
{
is_map_draw = false;
map_found = false;
// map_spr.deleteSprite();
// map_spr.createSprite(768, 768);
}
if (!is_map_draw)
{
OldMapTile.zoom = CurrentMapTile.zoom;
OldMapTile.tilex = CurrentMapTile.tilex;
OldMapTile.tiley = CurrentMapTile.tiley;
OldMapTile.file = CurrentMapTile.file;
log_v("TILE: %s", CurrentMapTile.file);
log_v("ZOOM: %d", zoom);
// Center Tile
map_found = map_spr.drawPngFile(SD, CurrentMapTile.file, 256, 256);
uint8_t centerX = 0;
uint8_t centerY = 0;
int8_t startX = centerX - 1;
int8_t startY = centerY - 1;
bool tileFound = false;
if (map_found)
{
for (int y = startY; y <= startY + 2; y++)
{
for (int x = startX; x <= startX + 2; x++)
{
if (x == centerX && y == centerY)
{
// Skip Center Tile
continue;
}
RoundMapTile = get_map_tile(getLon(), getLat(), zoom, x, y);
tileFound = map_spr.drawPngFile(SD, RoundMapTile.file, (x - startX) * tileSize, (y - startY) * tileSize);
if (!tileFound)
map_spr.fillRect((x - startX) * tileSize, (y - startY) * tileSize, tileSize, tileSize, LVGL_BKG);
}
}
}
is_map_draw = true;
}
if (map_found)
{
NavArrow_position = coord_to_scr_pos(getLon(), getLat(), zoom);
map_spr.setPivot(tileSize + NavArrow_position.posx, tileSize + NavArrow_position.posy);
map_rot.pushSprite(0, 27);
#ifdef ENABLE_COMPASS
heading = get_heading();
//map_spr.pushRotated(&map_rot, 360 - heading, TFT_TRANSPARENT);
map_spr.pushRotated(&map_rot, 0, TFT_TRANSPARENT);//保持地图不变
map_rot.fillRectAlpha(TFT_WIDTH - 48, 0, 48, 48, 95, TFT_BLACK);
map_rot.pushImageRotateZoom(TFT_WIDTH - 24, 24, 24, 24, 360 - heading, 1, 1, 48, 48, (uint16_t *)mini_compass, TFT_BLACK);
#else
map_spr.pushRotated(&map_rot, 0, TFT_TRANSPARENT);
#endif
map_rot.setTextColor(TFT_WHITE, TFT_WHITE);
map_rot.fillRectAlpha(0, 0, 50, 32, 95, TFT_BLACK);
map_rot.pushImage(0, 4, 24, 24, (uint16_t *)zoom_ico, TFT_BLACK);
map_rot.drawNumber(zoom, 26, 8, &fonts::FreeSansBold9pt7b);
map_rot.fillRectAlpha(0, 342, 70, 32, 95, TFT_BLACK);
map_rot.pushImage(0, 346, 24, 24, (uint16_t *)speed_ico, TFT_BLACK);
map_rot.drawNumber((uint16_t)GPS.speed.kmph(), 26, 350, &fonts::FreeSansBold9pt7b);
map_rot.fillRectAlpha(250, 342, 70, TFT_WIDTH - 245, 95, TFT_BLACK);
map_rot.setTextSize(1);
map_rot.drawFastHLine(255,360,60);
map_rot.drawFastVLine(255,355,10);
map_rot.drawFastVLine(315,355,10);
map_rot.drawCenterString(map_scale[zoom], 285, 350);
//sprArrow.pushRotated(&map_rot, 0, TFT_BLACK);
sprArrow.pushRotated(&map_rot, 180-heading, TFT_BLACK);//让导航箭头动起来,且与compass相反
}
as above shown, i changed the code and the map tile remains silent, meanwhile, the arrow navigtion changes with the mpu9250 module.
from icenav-v3.
Disabling map rotation is already planned for the next version of the program.
from icenav-v3.
ok,thanks.
from icenav-v3.
Related Issues (20)
- what iot device shoud i connect? HOT 8
- IMU initialization unsuccessful HOT 3
- Migrate to LVGL 9 HOT 3
- how to change the size of arrow navigation HOT 1
- how can i get the real point north via the compass? HOT 2
- where is the Compass Calibration HOT 1
- The current CI doesn't test all envs
- Makefab missing libs HOT 7
- Optimizing settings storage HOT 1
- Touch Calibration set hide buttons HOT 1
- Incorrect navigation arrow in vector maps
- LVGL Optimization HOT 1
- Optimize sensor reading
- Navigation Screen
- Map disappears when modifying the settings
- Custom Board STL files HOT 1
- Update Libraries
- Hide Button bar
- Add support for multiple displays
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icenav-v3.