Comments (7)
Hi @Botronics,
Please, try to be more precise. What is not working? Write a small example to reproduce the error. Tell me what do you expect and what's happening. Moreover, in the data folder there are examples how the file should be.
from fields2cover.
Currently you are supporting input file as gml file in fields2cover_ros, i would like to extend it to support json file.
I see support for it on your library, so i have modified code to import JSON.
f2c::Parser::importGml(field_file, fields_);
to
f2c::Parser::importJson(field_file, fields_);
Observations
roslaunch fields2cover_ros view_field.launch
... logging to /home/boson/.ros/log/bf7b2f04-a836-11ed-bb5f-1758cd0b6a87/roslaunch-boson-Predator-PH315-54-29889.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://boson-Predator-PH315-54:46201/
SUMMARY
========
PARAMETERS
* /rosdistro: noetic
* /rosversion: 1.15.15
* /visualizer/field_file: /home/boson/colco...
NODES
/
rqt_reconfigure (rqt_reconfigure/rqt_reconfigure)
rviz (rviz/rviz)
static_tf_fake (tf2_ros/static_transform_publisher)
visualizer (fields2cover_ros/visualizer_node)
auto-starting new master
process[master]: started with pid [29912]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to bf7b2f04-a836-11ed-bb5f-1758cd0b6a87
process[rosout-1]: started with pid [29937]
started core service [/rosout]
process[visualizer-2]: started with pid [29940]
process[rviz-3]: started with pid [29944]
process[rqt_reconfigure-4]: started with pid [29946]
process[static_tf_fake-5]: started with pid [29947]
terminate called after throwing an instance of 'std::invalid_argument'
what(): Coordinate system empty
[visualizer-2] process has died [pid 29940, exit code -6, cmd /home/boson/colcon_ws/devel_isolated/fields2cover_ros/lib/fields2cover_ros/visualizer_node __name:=visualizer __log:=/home/boson/.ros/log/bf7b2f04-a836-11ed-bb5f-1758cd0b6a87/visualizer-2.log].
log file: /home/boson/.ros/log/bf7b2f04-a836-11ed-bb5f-1758cd0b6a87/visualizer-2*.log
input json file is
{
"type":"FeatureCollection",
"features":
[
{
"type":"Feature",
"properties":{
"Name":"test parcel",
"Description":""
},
"geometry":{
"type":"Polygon",
"coordinates":[
[
[6.062131843297665,51.51238564279176,0],
[6.062215149507296,51.51204470468504,0],
[6.062232423018175,51.51197104647852,0],
[6.062259746209906,51.51187606814959,0],
[6.062326543909903,51.51176969020385,0],
[6.062616689510882,51.51132237283374,0],
[6.062774912818519,51.5110969639745,0],
[6.06391193897111,51.51128082116658,0],
[6.064611441945173,51.51145574331268,0],
[6.065098633989681,51.51158297850052,0],
[6.06535638240705,51.51164756662656,0],
[6.065281916969094,51.51201586112104,0],
[6.065198703086809,51.51242286506194,0],
[6.065032035452376,51.51326672760065,0],
[6.064917267603112,51.51323981877308,0],
[6.064599700873679,51.51316332038011,0],
[6.063277485615517,51.51281482302127,0],
[6.062724098497727,51.51267326409077,0],
[6.062443955933741,51.51253739011318,0],
[6.062131843297665,51.51238564279176,0]
]
]
}
}
]
}
from fields2cover.
This was already inside the library. Which is the problem then?
from fields2cover.
Observations
roslaunch fields2cover_ros view_field.launch
... logging to /home/boson/.ros/log/bf7b2f04-a836-11ed-bb5f-1758cd0b6a87/roslaunch-boson-Predator-PH315-54-29889.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://boson-Predator-PH315-54:46201/
SUMMARY
PARAMETERS
- /rosdistro: noetic
- /rosversion: 1.15.15
- /visualizer/field_file: /home/boson/colco...
NODES
/
rqt_reconfigure (rqt_reconfigure/rqt_reconfigure)
rviz (rviz/rviz)
static_tf_fake (tf2_ros/static_transform_publisher)
visualizer (fields2cover_ros/visualizer_node)
auto-starting new master
process[master]: started with pid [29912]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to bf7b2f04-a836-11ed-bb5f-1758cd0b6a87
process[rosout-1]: started with pid [29937]
started core service [/rosout]
process[visualizer-2]: started with pid [29940]
process[rviz-3]: started with pid [29944]
process[rqt_reconfigure-4]: started with pid [29946]
process[static_tf_fake-5]: started with pid [29947]
Error
terminate called after throwing an instance of 'std::invalid_argument'
what(): Coordinate system empty
[visualizer-2] process has died [pid 29940, exit code -6, cmd /home/boson/colcon_ws/devel_isolated/fields2cover_ros/lib/fields2cover_ros/visualizer_node __name:=visualizer __log:=/home/boson/.ros/log/bf7b2f04-a836-11ed-bb5f-1758cd0b6a87/visualizer-2.log].
log file: /home/boson/.ros/log/bf7b2f04-a836-11ed-bb5f-1758cd0b6a87/visualizer-2*.log
from fields2cover.
The error is on the transform function. Before it, you need to specify the coordinate system. This is due to json doesn't explicitly say which coordinate system is using. Fortunately GML does.
Just put a line before the transform call and after the import as
field.setEPSGCoordSystem(4326);
field
is a F2CField.
from fields2cover.
@Botronics Can I close it then?
from fields2cover.
Sure, thank you.
from fields2cover.
Related Issues (20)
- [Noetic] Fields2Cover failing to build on all platforms HOT 3
- a) how to launch the ros2 interface and b) how to import a field from a .shp format HOT 7
- Create Pypi package for the python interface
- Planning of Loops HOT 1
- 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.