Giter VIP home page Giter VIP logo

Comments (7)

Gonzalo-Mier avatar Gonzalo-Mier commented on May 28, 2024

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.

Botronics avatar Botronics commented on May 28, 2024

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.

Gonzalo-Mier avatar Gonzalo-Mier commented on May 28, 2024

This was already inside the library. Which is the problem then?

from fields2cover.

Botronics avatar Botronics commented on May 28, 2024

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.

Gonzalo-Mier avatar Gonzalo-Mier commented on May 28, 2024

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.

Gonzalo-Mier avatar Gonzalo-Mier commented on May 28, 2024

@Botronics Can I close it then?

from fields2cover.

RamanaBotta avatar RamanaBotta commented on May 28, 2024

Sure, thank you.

from fields2cover.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.