Comments (7)
Hi @helix22, welcome to the project!
First, I don't think you can delete the issue. It is good to have a log on doubts people have, so others can solve their questions faster too! btw, rename the issue if you can to give more context. About your questions:
a) Unfortunately the ROS demo was only available for ROS 1. The good part is that Nav2 is working on an interface with F2C.
b) Download your file as Well-Known Text (WKT). You can import a multipolygon as F2CCells c; c.importFromWkt("THE WKT INFO")
;
I hope this solve the issue :)
from fields2cover.
Hi @helix22,
There is an example in the tutorials on using importFromWkt for a point. Similarly, you can do the same with F2CCell. This is the code in python:
import fields2cover as f2c
c = f2c.Cell()
c.importFromWkt("POLYGON ((571826.879847092 4454303.72791723,571995.622984484 4454429.58217387,572016.674058808 4454401.14195982,571852.381533276 4454277.61374514,571826.879847092 4454303.72791723))")
f2c.Visualizer.figure()
f2c.Visualizer.plot(c)
f2c.Visualizer.show()
Hope this is useful!
from fields2cover.
Hello again! For the record and for anyone wondering in the future I sum up (please jump in where I am mistaken):
My query started since I could not transform the format of my field into the .xml format used in the tutorial 7_complete_flow. So, a field in a shp format, maybe from QGIS app (probably a number of files, 5 in my case: .cpg, .dbf, .shp, .prj, .shx) can be easily converted to WKT from here: https://mygeodata.cloud/converter/shp-to-wkt.
Then, you can create a Cell and import the polygon as above.
Then you can use:
cells = f2c.Cells()
cells.addGeometry(c)
And if using the exact tutorial 7, you will have to switch the "field.field" in the no_hl = ... to "cells", and also in the plotting later, as you have not defined "field" anywhere. So, like this, you can import any field/polygon from wkt format and easily work on it.
Many thanks to Gonzalo-Mier for the explanations.
from fields2cover.
Dear Gonzalo-Mier, thank you very much for this quick reply!!
Regarding the (1), okay good, I thought I was missing something, maybe I will try installing ROS1 to try it as well!
Regarding the (2), everything is clearer already, I just can't get to place my wkt data into the importFromWkt. Could you spend some more time in order to give me an example? i.e. if my field is this in WKT: "POLYGON ((571826.879847092 4454303.72791723,571995.622984484 4454429.58217387,572016.674058808 4454401.14195982,571852.381533276 4454277.61374514,571826.879847092 4454303.72791723))"
Thanks again!! :)
from fields2cover.
Done! Great! Ok now I will try to import "c" in the complete flow as a field and transform it to UTM to work in meters.
So many thanks! :)
from fields2cover.
from fields2cover.
Right! So the very last question of this thread would be.. Well obviously commenting out field = f2c.Parser... and the transform after, and even more obviously typing instead "field = c" (where c is my polygon that i imported from Wkt, for anyone checking please see above) does not work, so what am I missing for the n^th time? ('Cell' object has not attribute 'field'). A sincere apology for my lack of skills here.
from fields2cover.
Related Issues (20)
- [Noetic] Fields2Cover failing to build on all platforms HOT 3
- ROS humble pkg not found with C++ HOT 2
- Compile failed
- Option to have turns happen inside the polygon when leaving the polygon shape is not permissible HOT 3
- Compilation steps are not rendered HOT 4
- Does not compile with clang HOT 1
- Is it possible to use this library to plan a coverage path connecting multiple convex polygons? HOT 4
- AerialmapDisplay HOT 3
- Headland width is not constant HOT 2
- questions about headland generator HOT 7
- Can F2C work with wgs84 coordinates? HOT 5
- Connecting between two fields HOT 5
- Deactivate headland HOT 2
- ROS2 support HOT 2
- Exported path discritization HOT 4
- New discretize_swath() function import issue to cpp/ROS2 package HOT 2
- LineString() Points with wgs84 coordinates instead of X, Y ? HOT 6
- Docker Build Issue HOT 1
- Map API: AerialmapDisplay && Path sequences HOT 1
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 fields2cover.