Project Space Transportation System 2016

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Confused. Looking at actual images of the DM facing towards the shuttle. It appears the dock rotates? See on the view of the shuttle in sts 74 fin #3 is aligned with the keel support. But in sts 79 the docking ring is offset?
@DaveS any ideas?
 

Attachments

  • STS79DMVIEW.jpg
    STS79DMVIEW.jpg
    108 KB · Views: 10
  • sts74dmend1.jpg
    sts74dmend1.jpg
    71.8 KB · Views: 10

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,919
Reaction score
2,924
Points
188
Website
github.com
The STS-74 image obviously shows the Mir-side of the DM.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
The dock alignment is correct. But the moving dock with the docking Module with a 30 degree offset causes issues. I tried docking with DarkEnergy and the same issue. Not if there is a fix.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
I am not sure why the spin. All it is doing is undock and dock

//move ods dock void Atlantis::DoIDARing() { if (TUNNELODS == 1) { VECTOR3 new_dock_pos = _V(-0.042, 2.2250, 8.2264);; new_dock_pos.y += (soft_capture_ring_proc * 0.4);//0.45 OBJHANDLE v = GetHandle(); int idx = 0; // dock index OBJHANDLE docked_ship = GetDockStatus(GetDockHandle(0)); // object handle of docked vessel if (docked_ship != NULL) // make sure handle is valid, if it is... { VESSEL* docked = oapiGetVesselInterface(docked_ship); // get VESSEL interface for docked vessel int dcount = docked->DockCount(); // get number of docking ports for (int i = 0; i < dcount; i++) // Cycle through ports { if (docked->GetDockStatus(docked->GetDockHandle(i)) == GetHandle()) { idx = i; docked->Undock(idx, 0); //SetDockParams(hDockODS2, new_dock_pos, _V(0, 1, 0) , _V(0, 0, -1)); //sprintf(oapiDebugString(), "SHUTTLE_DOCKDIR.x %lf SHUTTLE_DOCKDIR.y %lf SHUTTLE_DOCKDIR.z %lf SHUTTLE_DOCKROT.x %lf SHUTTLE_DOCKROT.y %lf SHUTTLE_DOCKROT.z %lf", SHUTTLE_DOCKDIR.x, SHUTTLE_DOCKDIR.y, SHUTTLE_DOCKDIR.z, SHUTTLE_DOCKROT.x, SHUTTLE_DOCKROT.y, SHUTTLE_DOCKROT.z); docked->Dock(v, idx, 0, 0); } } //} } } }
 

diogom

Well-known member
Joined
Aug 2, 2010
Messages
1,372
Reaction score
413
Points
98
Have you tried using Dock(v, idx, 0, mode) with mode 1 or 2?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Yes. Same result. It seems the dm docking values?
CreateDock(_V(-0.042, 0, 2.136), _V(0, 0, 1), _V(0, -1, 0)); MIR CreateDock(_V(-0.006, 0.000, - 2.125), _V(0, 0, -1), _V(0.500011, -0.866019, 0)); Shuttle

If I dock with MIR docking port no issues.



void Atlantis::DoIDARing() { //sprintf(oapiDebugString(), "new_dock_pos.y %lf soft_capture_ring_proc %lf ", new_dock_pos.y, soft_capture_ring_proc); if (TUNNELODS == 1) { VECTOR3 new_dock_pos = _V(-0.042, 2.2250, 8.2264);; new_dock_pos.y += (soft_capture_ring_proc * 0.4);//0.45 OBJHANDLE v = GetHandle(); int idx = 0; // dock index OBJHANDLE docked_ship = GetDockStatus(GetDockHandle(0)); // object handle of docked vessel if (docked_ship != NULL) // make sure handle is valid, if it is... { VESSEL* docked = oapiGetVesselInterface(docked_ship); // get VESSEL interface for docked vessel int dcount = docked->DockCount(); // get number of docking ports for (int i = 0; i < dcount; i++) // Cycle through ports { if (docked->GetDockStatus(docked->GetDockHandle(i)) == GetHandle()) { idx = i; docked->Undock(idx, 0); SetDockParams(hDockODS2, new_dock_pos, _V(0, 1, 0), _V(0, 0, -1)); docked->Dock(v, idx, 0, 0); } } } else { SetDockParams(hDockODS2, new_dock_pos, _V(0, 1, 0), _V(0, 0, -1)); } } }


When the scn starts I can kill the angular rotation of the shuttle but then it starts back up
 
Last edited:

diogom

Well-known member
Joined
Aug 2, 2010
Messages
1,372
Reaction score
413
Points
98
So the thing is, as the ring retraction plays out and it undocks and docks, it induces angular rotation on the shuttle+DM? I had somehow understood it was the docking module's docked angle which was changing.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
So the thing is, as the ring retraction plays out and it undocks and docks, it induces angular rotation on the shuttle+DM? I had somehow understood it was the docking module's docked angle which was changing.
Yes. Because the docking module alignment is 30 degrees off center. It causes the angular rotation
 

diogom

Well-known member
Joined
Aug 2, 2010
Messages
1,372
Reaction score
413
Points
98
I don't recall if I had trouble with angular motion, but I did have an issue where each time it docked, the orbit would change, over the whole sequence it added up to quite a bit. The "teleportation" probably disturbs a few things. Try using GetAngularVel before undocking and SetAngularVel after redocking with the same vector. For the orbit thing, I had to do similar with Get and SetElements.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
I wonder if I have the dock on the mesh correct. I have it matched to the drawing/ images. It looks to align with the shuttle the docking module needs to be 30 degrees offset.
Any thoughts? @DaveS @Max-Q
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Rethinking the docking module.

Here is STS 76. As you can see fin 3 of the DM is along the z axis. Maybe the dock is 0,0,-1 but the mesh is rotated 30 degrees?
 

Attachments

  • sts76dock1.jpg
    sts76dock1.jpg
    104.3 KB · Views: 2

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
The docking Module mesh is correct. To dock with the shuttle. the docking Module has to be rotated 30 degrees

Here the DM mesh is rotated 30 degrees
 

Attachments

  • dmdockalignment.jpg
    dmdockalignment.jpg
    91.1 KB · Views: 1
  • shuttledockdm.jpg
    shuttledockdm.jpg
    52 KB · Views: 1

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Trying to get the new moving dock code to work. But have another issue. I can't seem to find what is happening.

For the dock ring animation I have this:
if (TUNNELODS == 1) {//ODS is present if (APAS_status >= DOCK_RAISING) { double da = simdt * .1; if (APAS_status == DOCK_RAISING) { if (soft_capture_ring_proc > 0.0) soft_capture_ring_proc = max(0.0, soft_capture_ring_proc - da); else APAS_status = DOCK_UP; } else { if (soft_capture_ring_proc < 1.0) soft_capture_ring_proc = min(1.0, soft_capture_ring_proc + da); else APAS_status = DOCK_DOWN; } SetAnimation(anim_DOCKRING, soft_capture_ring_proc); //SetAnimation(anim_rods, soft_capture_ring_proc); CalculateRodAnimation(); //DoIDARing(); } }
enum APAS_status { DOCK_UP, DOCK_DOWN, DOCK_RAISING, DOCK_LOWERING }APAS_status;

void Atlantis::RevertDockingRing(void) { APAS_status = ((APAS_status == DOCK_UP || APAS_status == DOCK_RAISING) ? DOCK_LOWERING : DOCK_RAISING); }
APAS_status = DOCK_UP;
where is where it is saved:
sprintf(cbuf, "%d %0.4f", &APAS_status, &soft_capture_ring_proc); oapiWriteScenario_string(scn, "DOCKAPAS", cbuf); and read:
else if (!_strnicmp(line, "DOCKAPAS", 8)) { sscanf(line + 8, "%d%lf", &APAS_status, &soft_capture_ring_proc); }

The scenario starts out:DOCKAPAS 0 0.0000
and run the scenario and not pressing any keys
I get this:
DOCKAPAS 385911332 0.0000
 

diogom

Well-known member
Joined
Aug 2, 2010
Messages
1,372
Reaction score
413
Points
98
I think when you pass &APAS_status to sprintf, you're actually saving the address, not the value, hence the weird number. Same would go for the proc, curious that it's saving 0 anyway, though I think it might be expecting a float (%0.4f) when proc is I'm assuming a double (lf), dunno if that trips it up.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
I think when you pass &APAS_status to sprintf, you're actually saving the address, not the value, hence the weird number. Same would go for the proc, curious that it's saving 0 anyway, though I think it might be expecting a float (%0.4f) when proc is I'm assuming a double (lf), dunno if that trips it up.
Thanks

But all these work
else if (!_strnicmp(line, "PETD", 4)) { sscanf(line + 4, "%d%lf", &PETD_status, &PETD_proc); }
works
sprintf(cbuf, "%d %0.4f", EXT_status, EXT_proc); oapiWriteScenario_string(scn, "HATCH", cbuf);
enum APAS_status { DOCK_UP, DOCK_DOWN, DOCK_RAISING, DOCK_LOWERING }APAS_status; should be a single digit 0=dock up,.....

It seems to be good until it saves it.

So I added breaks to see where it was changed.

and at is good by the end of this when I exit;
void Atlantis::clbkSaveState(FILEHANDLE scn) {
Not sure what function is next to put a break?
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Fixed the save state of the docking ring.
UGH
sprintf(cbuf, "%d %0.4f", APAS_status, soft_capture_ring_proc); oapiWriteScenario_string(scn, "DOCKAPAS", cbuf);

I need to better align the dock. But the moving dock works. I get a CTD when I undock though
 

Attachments

  • dockcamview.jpg
    dockcamview.jpg
    56.5 KB · Views: 5
  • dockcamview1.jpg
    dockcamview1.jpg
    66.4 KB · Views: 5

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Thanks to @Max-Q and @diogom I got the moving dock to capture the Docking Module and lower to the shuttle. The scn starts and you grab the DM and move into position,
 

Attachments

  • sts74dmdock3.jpg
    sts74dmdock3.jpg
    42.3 KB · Views: 17
  • sts74dmdock2.jpg
    sts74dmdock2.jpg
    83.5 KB · Views: 15
  • sts74dmdock1.jpg
    sts74dmdock1.jpg
    67.9 KB · Views: 18
  • sts74rmsdm.jpg
    sts74rmsdm.jpg
    106.2 KB · Views: 18

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Because there are 2 docks position. I just show which mesh and set the dock position. But. I need to see if I can use the same mesh so that the animation remains the same. And then have. ODSmesh show up at x,y,z position. And just change the XYZ position.

On the dock alignment. As I understand. The ODS mesh fits on top of the external airlock. So mesh alignment. then adjust the dock so that the docking target aligns with the crosshairs, right
 
Top