Please login or register.

Login with username, password and session length

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.

Author Topic: Creating a controller program  (Read 35953 times)

February 10, 2014, 07:24:50 PM
Reply #15
  • Administrator
  • Member
  • *****
  • Posts: 159
    • View Profile
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.

February 12, 2014, 02:34:07 AM
Reply #16
  • Member
  • **
  • Posts: 12
    • View Profile
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

February 12, 2014, 02:47:35 AM
Reply #17
  • Member
  • **
  • Posts: 12
    • View Profile
changed TerrainLat(1) to 30 as I think I had that wrong but still same depth at the beginning.

February 16, 2014, 05:31:11 PM
Reply #18
  • Administrator
  • Member
  • *****
  • Posts: 159
    • View Profile
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
Code: [Select]
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.

June 28, 2024, 02:46:32 PM
Reply #19
  • Member
  • **
  • Posts: 4
    • View Profile
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

June 28, 2024, 11:21:53 PM
Reply #20
  • Administrator
  • Member
  • *****
  • Posts: 159
    • View Profile
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.
   

June 29, 2024, 02:51:50 PM
Reply #21
  • Member
  • **
  • Posts: 4
    • View Profile
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

July 18, 2024, 10:09:06 PM
Reply #22
  • Administrator
  • Member
  • *****
  • Posts: 159
    • View Profile
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!

July 25, 2024, 09:26:26 AM
Reply #23
  • Member
  • **
  • Posts: 4
    • View Profile
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 ?
« Last Edit: July 25, 2024, 10:01:03 AM by hadi23 »

August 01, 2024, 11:06:20 AM
Reply #24
  • Member
  • **
  • Posts: 4
    • View Profile
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