Jump to content

Geoposition EntityPacket


photo

Recommended Posts

update()

image.png.985ccaec9fd37d939da8ef7ad3d7d329.png

 

If the host sends an Entity packet that does not move, the IG creates an Entity in the wrong place.

However, if I change the parameter value of the positioning function every frame, it is created normally. ( ex]  cano.SetAlt(0 +i) )

This experimented with my Host sample, not Hemu.

 

Which option is wrong in IG?

Is it related to interpolation?

Link to comment

I sent this packet  every frame.

I just fixed the entity in one place without moving it.

Edited by dongju.jeong
Link to comment
  • 2 weeks later...

I think this problem caused the clamp problem.

Because when I made an entity that didn't move, not only was the clamp not applied, but the generating location was wrong.

However, when some movement was applied, the position and clamp were applied normally.

 

image.png.5e20f10b65e82d028ea55422885f7dbb.png This was done as I intended.

 

image.png.bd2dd04484ae50fa7db66ba8f16613b7.png this is not.

 

//========================================================================================

image.png.0a4be5d447588ce4047d440eabf8cdfc.png

When I checked the location, I found a different value than the one sent by the host.

 

cigi packet's value is normal.

Log::message("%f, %f\n", vd->getPosition().x, vd->getPosition().y);                   // it is same with host's value.

Edited by dongju.jeong
Link to comment
On 4/17/2020 at 9:48 AM, dongju.jeong said:

Is it related to interpolation?

may be. please try to check with 

cano.SetSmoothingEn(0);


I need a little time to check out this at 2.9 with a custom host.

Link to comment

Hello Dong Ju,

From our perspective there's no issue on the IG's or the engine's sides. As far as I understood, you wrote a custom host application based on a cigi_ccl_src_ver_3_3_3 library.

We performed a test both with HEMU and custom host app, coordinates were correct.

To check the case with HEMU we changed two lines (default_latitude and default_longitude) in hemu/default/Terrain.def file.

Then wrote debug output for the IG application:

void AppSystemLogic::init_cigi()
{
	int index = Engine::get()->findPlugin("CIGIConnector");

	// check CIGIConnector plugin load
	if (index < 0)
		return;

	// get CIGI interface
	cigi = (IG::CIGI::ConnectorInterface*)Engine::get()->getPluginData(index);

	cigi->setReceivePacketCallback(IG::CIGI::CIGI_OPCODE_ENTITY_CONTROL, MakeCallback(this, &AppSystemLogic::entity_control));
}

void AppSystemLogic::entity_control(IG::CIGI::ICigiEntityControl * control)
{
	int id = control->getEntityID();
	Log::message(" (%d)cigi geopos %f %f\n", id, control->getPosition().x, control->getPosition().y);
	auto entity_pos = ig_manager->getEntity(id)->getGeoPosition();
	Log::message(" (%d)ig geopos %f %f\n", id, entity_pos.x, entity_pos.y);
	auto world = ig_manager->getEntity(id)->getNode()->getWorldPosition();
	auto geo = ig_manager->getConverter()->worldToGeodetic(world);
	Log::message(" (%d)engine geopos %f %f\n", id, geo.x, geo.y);
}

This code will output into the console three lines:

  1. Coordinates received from the host application
  2. Coordinates kept by IG after the package was applied
  3. Coordinates of the airplane node

This is what we get:

  1.  (1)cigi geopos 36.000000 12.000000
  2.  (1)ig geopos 36.00000 12.000000
  3.  (1)engine geopos 36.000000 12.000000

Then we ran a test with custom host:

CigiEntityCtrlV3_3 entctrl;
entctrl.SetAlpha(255);
entctrl.SetAnimationDir(CigiEntityCtrlV3_3::Forward);
entctrl.SetAnimationLoopMode(CigiEntityCtrlV3_3::Continuous);
entctrl.SetAnimationState(CigiEntityCtrlV3_3::Stop);
entctrl.SetAttachState(CigiEntityCtrlV3_3::Detach);
entctrl.SetParentID(0);
entctrl.SetCollisionDetectEn(CigiEntityCtrlV3_3::Disable);
entctrl.SetEntityID(_data->_cigiEntityId);
entctrl.SetEntityState(CigiEntityCtrlV3_3::Active);
entctrl.SetEntityType(200);
entctrl.SetGrndClamp(CigiEntityCtrlV3_3::AltAttClamp);
entctrl.SetInheritAlpha(CigiEntityCtrlV3_3::NoInherit);
entctrl.SetLat(36);
entctrl.SetLon(12);
entctrl.SetAlt(2000);
entctrl.SetYaw(_yaw);
entctrl.SetPitch(_pitch);
entctrl.SetRoll(_roll);
entctrl.SetSmoothingEn(0); // You don't have this line

And get the very same result as before:

  1.  (22)cigi geopos 36.000000 12.000000
  2.  (22)ig geopos 35.999974 12.000000
  3.  (22)engine geopos 35.999974 12.000000

At this point we do not observe any issues unless something was missed or you have anything to add.

Thanks!

  • Like 2

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

image.png.4d7cf060f705ed64188607183887ebbe.png

image.png.0a4be5d447588ce4047d440eabf8cdfc.png

 

after Script loading and World loading, value is changed.

is there any doubts?

 

Or can you test it with my project?

 

Edited by dongju.jeong
Link to comment
  • 2 weeks later...

hello. 

I use GeodeticPivot like this.

and I generated terrain with turn off curved option.

image.png.960d984e7e6186a9edcd312bf1efedf5.pngimage.png.de79ba8b336efac71578055c52c96ee7.png

Edited by dongju.jeong
Link to comment

We found what was the problem!

You create an entity before loading the world. At this time, the pivot geodetic does not exist, and IG operates in world coordinate mode, because it does not know how to interpret geo-coordinates.

After loading the world, the positions of entities are not updated automatically. But when you request a geolocation, the world coordinates are converted to geocoordinates.


You can solve this by re-sending the package with geocoordinates, or just create an entity after loading the world.

  • Like 1
Link to comment

thank you so much.

This is work when I send Entitiy packet after loading the world.

 

Can I know what it means to resend a packet with geocordinate?

I kept sending the same Entity packet to every frame before and after the world load. but the same problem had appeared.

I don't think this is what your solution means.

 

Link to comment
On 5/11/2020 at 8:37 AM, dongju.jeong said:

Can I know what it means to resend a packet with geocordinate?

I'm sorry, this wouldn't work in a straightforward way. You can do this as follows:

  1. Send entity control packet with 0,0,0 coordinates
  2. Send entity control again with correct coordinates

This should be done once after world was loaded.

However, the best solution here is to create an entity after the world was loaded.

Thanks.

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...