News:

Registration is only required if you want to post, and is not needed to read any posts. To avoid excess 'spam' accounts, all accounts where no posts have been made will be deleted after two weeks. Please register again if you wish to post.

Main Menu

Creating a controller program

Started by huckleberry, January 21, 2014, 11:11:12 PM

Previous topic - Next topic

forum_admin

Hi, I've looked into this a little more. If you start on the defined world area, and move off it, Bridge Command assumes that the seabed depth stays the same as the point just before you left the map, and if you start off the map, it will assume a depth of zero.

To find the depth under the keel, the tidal height is added, and the ship's draught taken away. Therefore if you have any tides configured, you may be 'running aground' when the tide falls. If this is the problem, starting on the defined world area, and making sure that it's deep enough to avoid any grounding should fix the problem.

Alternatively, there may be some sort of numerical jitter that's causing the maintained depth to reduce over time, but that seems quite unlikely.

huckleberry

I have decided it is something wrong with my world.  I am trying to use a file from the SRTM data.  The stats from it are:
Latitude min: 30 N      
             max: 35 N
   
Longitude min: 80 W      
                max: 75 W
   
Center point :
   Latitude 32.50 N
   Longitude 77.50 W

I have the boat start at the center point.  32.50,-77.50.

I noticed that it starts with depth under keel of 1.1

See anything wrong with the terrain.ini?  If I just wanted an empty map, would I just create an all-black bmp for height, texture and radar? 
I created a 2048x2048 bmp for the height map.

My terrain.ini looks like:
Number=1

RadarImage="radar.bmp"

HeightMap(1)="height.bmp"
Texture(1)="texture.bmp"
TerrainLong(1)=-80
TerrainLat(1)=35
TerrainLongExtent(1)=5.0
TerrainLatExtent(1)=5.0
TerrainMaxHeight(1)=633.0
SeaMaxDepth(1)=2063
TerrainHeightMapSize(1)=2048

huckleberry

changed TerrainLat(1) to 30 as I think I had that wrong but still same depth at the beginning.

forum_admin

Hi, that all looks reasonable. I've tried replicating your terrain.ini file (with TerrainLat(1)=30), using a plain black image for the heightmap, and it behaves as expected, with a large depth when the vessel starts at

InitialLong=-77.5
InitialLat=32.5
.
Is it possible that you may have switched the Lat and Long starting positions, so you're starting off the map?

Just one additional comment - because the height map is loaded from an image with only 256 grey shades, a terrain with such a large height range (-2063 to 633 metres) will load with large 'steps' visible in the land, as the height will only be resolved to the nearest ~10m. For very large depths (defaulting to 100m), the depth sounder will just read "-", so it may be best to truncate any depths below ~110 metres, which would increase the resolution of the heights that can be displayed.

hadi23

Hello evryone,


i want to simulate Boat's Dynamics (i.e a python file sending BC messages)

i do not know how to make this work (i tried).

can you please make me a step by step description or a python files that works to have a look how you did it?

thank you

forum_admin

Hi, the discussion above was related to an earlier version of Bridge Command that used UDP networking directly. The current version still uses UDP, but via the enet networking library, so you will need a python wrapper to this. I think pyenet may be what you need.

Depending on what you want to do, you can see the networking parts of Bridge Command in https://github.com/bridgecommand/bc/blob/main/src/NetworkPrimary.cpp, and for the map controller in https://github.com/bridgecommand/bc/blob/main/src/controller/Network.cpp.

Alternatively, it might be easier to modify OwnShip.cpp, either to do what you want directly, or to add an interface to your code.
   

hadi23

thank you for your response.

yes, i am using the 4.7 version. when i send the BC messages or even the MC messages i have memory access violation and i have not find the issue.(i am using a simulator that delivers all the information (speed, position, etc ...)

can you help me please?

thank's

forum_admin

Hi, I don't have a copy of huckleberry's code, it might be best if you try sending a PM? If this doesn't work, let me know, but it is quite a while since I have worked on version 4.7!

hadi23

#23
I tried to send Bc messages to 3d "secondary display " the other one was in networked main but thers is overloop (the main one is sending BC messages and i also send BC messages from my script).

but i tried to only send BC and SC messages to Secondry display (without starting bridgecommand in networked main) but the secondary display does not launch when i send the messages.

or the secondary display launches if and only if Bridgecommand is started on networked main ?

hadi23

Hello evryone,

can someone provide me the source code for BC 4.7 version please?

i have problems with MC messages data encoding

Thank you