Project Updated SLS for Orbiter 2016 (and 2010)

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
OK. I may model the new pad/hill like the ssu one so that the touchdown points will remain the same.

This is why I was using attachment points:).


Here are the 2 area to compare. On the top view the green one is the non SSU
On the side view the taller one is the SSU

padcompare1.jpg

padcompare.jpg


---------- Post added at 03:43 PM ---------- Previous post was at 08:17 AM ----------

oK. The SSu mesh LC39_hardstand is a good one without alot of extra structures. So I made a cfg and used that mesh. Then added it and adjusted. no issues. The issue comes when I delete the ssu_pad. I get a CTD and nothing in the log
cfg
Code:
MeshName = SSU/LC39A_hardstand
Size = 200

scn:
Code:
BEGIN_DESC
Contains the latest simulation state.
END_DESC

BEGIN_ENVIRONMENT
  System Sol
  Date MJD 54278.5328779857
  Context SSU
END_ENVIRONMENT

BEGIN_FOCUS
  Ship Crawler-Transporter
END_FOCUS

BEGIN_CAMERA
  TARGET L39SLS
  MODE Extern
  POS 4.13 -38.71 -44.83
  TRACKMODE TargetRelative
  FOV 40.00
END_CAMERA

BEGIN_VC
END_VC

BEGIN_SHIPS
Crawler-Transporter:SSU_CT
  STATUS Orbiting Earth
  RPOS 5030462.11 1818249.49 3460952.67
  RVEL -178.810 -145.732 336.461
  AROT 35.98 37.56 95.06
  AFCMODE 7
  NAVFREQ 0 0
  VELOCITY 0.00
  TGT_VELOCITY 0.00
  STEERING_ACTUAL 0.000000 0.000000
  STEERING_COMMANDED 0.000000 0.000000
  JACK_HEIGHT 0.40
  TARGET_JACK_INDEX 0
  ANGLE 0.010000 0.010000
  VIEWPOS 0
  STANDALONE 0
  GROUND_POS 0.4989492637 -1.4076933883 0.6813765400
@SUBSYSTEM Engine
  ENGINE_POWER 0.00
  ENGINE_STATE 0
@ENDSUBSYSTEM		;Engine
  @PANEL FWD_CAB_LEFT
  "NEUT" SET
  @ENDPANEL 
  @PANEL FWD_CAB_CTR
  @ENDPANEL 
  @PANEL FWD_CAB_RIGHT
  "GreatCircle" SET
  @ENDPANEL 
  @PANEL REAR_CAB_LEFT
  "NEUT" SET
  @ENDPANEL 
  @PANEL REAR_CAB_CTR
  @ENDPANEL 
  @PANEL REAR_CAB_RIGHT
  "GreatCircle" SET
  @ENDPANEL 
END
L39SLS:LP39PAD_SLS
  STATUS Landed Earth
  POS -80.6041220 28.6078150
  HEADING 270.00
  AFCMODE 7
  NAVFREQ 0 0
END
END_SHIPS

BEGIN_Attachment Manager
END

BEGIN_ReFuelMFD
  SCENARIO_TREE 
    NAMED Computers
    END_NODE 
  END_NODE 
END

log:
Code:
**** Creating simulation session
DirectDraw interface OK
Direct3D interface OK
Graphics: Viewport: Window 1914 x 1051 x 32
Graphics: Hardware T&L capability: Yes
Graphics: Z-buffer depth: 32 bit
Graphics: Active lights supported: 8
Loading 15382 records from star database
Module Sun.dll ............... [Build 100830, API 100830]
VSOP87(E) Sun: Precision 1e-006, Terms 554/6634
Module Mercury.dll ........... [Build 100830, API 100830]
VSOP87(B) Mercury: Precision 1e-005, Terms 167/7123
Module Venus.dll ............. [Build 100830, API 100830]
Module VenusAtm2006.dll ...... [Build 100830, API 100830]
VSOP87(B) Venus: Precision 1e-005, Terms 79/1710
Module Earth.dll ............. [Build 100830, API 100830]
Module EarthAtmJ71G.dll ...... [Build 100830, API 100830]
VSOP87(B) Earth: Precision 1e-008, Terms 2564/2564
Module Moon.dll .............. [Build 100830, API 100830]
ELP82: Precision 1e-005, Terms 116/829
Module Mars.dll .............. [Build 100830, API 100830]
Module MarsAtm2006.dll ....... [Build 100830, API 100830]
VSOP87(B) Mars: Precision 1e-005, Terms 405/6400
Module Phobos.dll ............ [Build ******, API 060425]
Module Deimos.dll ............ [Build ******, API 060425]
Module Galsat.dll ............ [Build 100217, API 100215]
Module Jupiter.dll ........... [Build 100830, API 100830]
VSOP87(B) Jupiter: Precision 1e-006, Terms 1624/3625
Module Io.dll ................ [Build 100217, API 100215]
Module Europa.dll ............ [Build 100217, API 100215]
Module Ganymede.dll .......... [Build 100217, API 100215]
Module Callisto.dll .......... [Build 100217, API 100215]
Module Satsat.dll ............ [Build 100215, API 100212]
Module Saturn.dll ............ [Build 100830, API 100830]
VSOP87(B) Saturn: Precision 1e-006, Terms 2904/6365
Module Mimas.dll ............. [Build 100215, API 100212]
SATSAT Mimas: Terms 113
Module Enceladus.dll ......... [Build 100215, API 100212]
SATSAT Enceladus: Terms 33
Module Tethys.dll ............ [Build 100215, API 100212]
SATSAT Tethys: Terms 101
Module Dione.dll ............. [Build 100215, API 100212]
SATSAT Dione: Terms 59
Module Rhea.dll .............. [Build 100215, API 100212]
SATSAT Rhea: Terms 68
Module Titan.dll ............. [Build 100215, API 100212]
SATSAT Titan: Terms 100
Module Iapetus.dll ........... [Build 100215, API 100212]
SATSAT Iapetus: Terms 605
Module Uranus.dll ............ [Build 100830, API 100830]
VSOP87(B) Uranus: Precision 1e-006, Terms 1827/5269
Module Miranda.dll ........... [Build ******, API 060425]
Module Ariel.dll ............. [Build ******, API 060425]
Module Umbriel.dll ........... [Build ******, API 060425]
Module Titania.dll ........... [Build ******, API 060425]
Module Oberon.dll ............ [Build ******, API 060425]
Module Neptune.dll ........... [Build 100830, API 100830]
VSOP87(B) Neptune: Precision 1e-006, Terms 391/2024
Finished initialising world
Module SSU_Crawler.dll ....... [Build 150818, API 100830]
Added subsystem Engine.
BasicPanel[FWD_CAB_RIGHT]:	Define VC Animations. 12 components
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicPanel[REAR_CAB_RIGHT]:	Define VC Animations. 12 components
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
BasicVCComponent:	Define VC Animations
@SUBSYSTEM Engine
FWD_CAB_LEFT
		Parse panel block for panel "FWD_CAB_LEFT"...
	Look up switch "NEUT"...		(SET)
	Found switch.
	Read switch state.
SET
		Done.
	Leave @PANEL block.
FWD_CAB_CTR
		Parse panel block for panel "FWD_CAB_CTR"...
		Done.
	Leave @PANEL block.
FWD_CAB_RIGHT
		Parse panel block for panel "FWD_CAB_RIGHT"...
	Look up switch "GreatCircle"...		(SET)
	Found switch.
	Read switch state.
SET
		Done.
	Leave @PANEL block.
REAR_CAB_LEFT
		Parse panel block for panel "REAR_CAB_LEFT"...
	Look up switch "NEUT"...		(SET)
	Found switch.
	Read switch state.
SET
		Done.
	Leave @PANEL block.
REAR_CAB_CTR
		Parse panel block for panel "REAR_CAB_CTR"...
		Done.
	Leave @PANEL block.
REAR_CAB_RIGHT
		Parse panel block for panel "REAR_CAB_RIGHT"...
	Look up switch "GreatCircle"...		(SET)
	Found switch.
	Read switch state.
SET
		Done.
	Leave @PANEL block.
(SpaceShuttleUltra) [DEBUG] Panel state violation in FWD_CAB_LEFT, not defined at Realize()
(SpaceShuttleUltra) [DEBUG] Panel state violation in FWD_CAB_CTR, not defined at Realize()
(SpaceShuttleUltra) [DEBUG] Panel state violation in REAR_CAB_LEFT, not defined at Realize()
(SpaceShuttleUltra) [DEBUG] Panel state violation in REAR_CAB_CTR, not defined at Realize()
Finished initialising status
Finished initialising camera
CrawlerRightPanel::RegisterVC() called
(SpaceShuttleUltra) [DEBUG] Panel state violation in FWD_LDS, not realized at RegisterVC()
Finished initialising panels
Finished setting up render state
 
Last edited:

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
[/COLOR]oK. The SSu mesh LC39_hardstand is a good one without alot of extra structures. So I made a cfg and used that mesh. Then added it and adjusted. no issues. The issue comes when I delete the ssu_pad. I get a CTD and nothing in the log
Reproduced in a clean SSU installation. Filed an official ticket for it.
 

Loopos

Procrastination Master
Joined
Sep 17, 2016
Messages
38
Reaction score
9
Points
8
Can someone attach a file, I cant go to the website to download the main thing (dropbox website)?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
ok. Updated my crawler.
SLSCCRAWLERVC1.jpg

SLSCCRAWLERVC2.jpg


But The next think I want to add is the change touchdown points to climb the hill
I have looked at the SSU crawler.

But I have run into some obstacles.

this is not defined:vhLC39
Code:
void SLSCRAWLER::FindLaunchpads()
{
	for (DWORD i = 0; i<oapiGetVesselCount(); i++) {
		OBJHANDLE hVessel = oapiGetVesselByIndex(i);
		if (hVessel && !_strnicmp(oapiGetVesselInterface(hVessel)->GetClassName(), "SLS_Pad", 7)) {
			vhLC39.push_back(hVessel);
			//oapiWriteLog("Found pad");
		}
	}
}
but it is in the h
Code:
	OBJHANDLE hEarth;
	std::vector<OBJHANDLE> vhLC39;

};
Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {

	// check distance from pads; adjust touchdown points to simulate going up ramp
	for (unsigned int i = 0; i < vhLC39.size(); i++) {
		//VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);

		VECTOR3 rpos = CalcRelSurfPos(vhLC39[i], vs);

		if (UpdateTouchdownPoints(rpos)) break;
	}


}

Not sure where UltraMath.h is?

Code:
	3	IntelliSense: identifier "range" is undefined	e:\orbiter2010p1A\Orbitersdk\samples\SLSCRAWLER\SLSCRAWLER.H	76	46	SLSCRAWLER
	4	IntelliSense: this declaration has no storage class or type specifier	e:\orbiter2010p1A\Orbitersdk\samples\SLSCRAWLER\SLSCRAWLER.H	86	2	SLSCRAWLER
	5	IntelliSense: namespace "std" has no member "vector"	e:\orbiter2010p1A\Orbitersdk\samples\SLSCRAWLER\SLSCRAWLER.H	86	7	SLSCRAWLER
	6	IntelliSense: expected a ';'	e:\orbiter2010p1A\Orbitersdk\samples\SLSCRAWLER\SLSCRAWLER.H	86	13	SLSCRAWLER
 

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Looks awesome gattispilot! Wish I could help you with the code.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
I got it to compile. But not sure what adjustments need to happen.in the scenario:

SLS_Pad:SLS\LP39PAD

But the touchdown are the same.
Code:
void SLSCRAWLER::FindLaunchpads()
{
    for (DWORD i = 0; i<oapiGetVesselCount(); i++) {
        OBJHANDLE hVessel = oapiGetVesselByIndex(i);
        if (hVessel && !_strnicmp(oapiGetVesselInterface(hVessel)->GetClassName(), "SLS_Pad", 7)) {
            vhLC39.push_back(hVessel);
            //oapiWriteLog("Found pad");
        }
    }
}
So it finds the sls_pad vessel

Well I went to these touchdown point and now the crawler is under the ground tilted.

I think I like the old touchdown.

Code:
    SetTouchdownPoints(_V(0, jackHeight + curFrontHeight, 20.0), _V(-15, jackHeight + curFrontHeight, -20.0), _V(15, jackHeight + curFrontHeight, -20.0));;


---------- Post added 10-24-16 at 06:08 AM ---------- Previous post was 10-23-16 at 06:52 PM ----------

oK. looking at the code:
Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {

    // check distance from pads; adjust touchdown points to simulate going up ramp
    for (unsigned int i = 0; i < vhLC39.size(); i++) {
        //VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);

        VECTOR3 rpos = CalcRelSurfPos(vhLC39[i], vs);
        sprintf(oapiDebugString(), "xdf %2.2fzdf %2.2f ydf %2.2f",  rpos.x, rpos.z, rpos.y);

        if (UpdateTouchdownPoints(rpos)) break;
    }


}
when i run the debugger I get vhLC39.size=0

Code:
void SLSCRAWLER::FindLaunchpads()
{
    for (DWORD i = 0; i<oapiGetVesselCount(); i++) {
        OBJHANDLE hVessel = oapiGetVesselByIndex(i);
        if (hVessel && !_strnicmp(oapiGetVesselInterface(hVessel)->GetClassName(), "SLS_Pad", 7)) {
            vhLC39.push_back(hVessel);
            //oapiWriteLog("Found pad");
        }
    }
}
Not sure why the size is not picking up as the size of the sls_pad?

---------- Post added at 04:07 PM ---------- Previous post was at 06:08 AM ----------

This is what I get in the debugger
Code:
-        vhLC39    { size=0 }    std::vector<void *,std::allocator<void *> >
        [size]    0    int
        [capacity]    0    int
+        [Raw View]    0x043f861c {...}    std::vector<void *,std::allocator<void *> > *
Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {
    if (!firstTimestepDone) DoFirstTimestep();

    // check distance from pads; adjust touchdown points to simulate going up ramp
    for (unsigned int i = 0; i<vhLC39.size(); i++) {
        
    // check distance from pads; adjust touchdown points to simulate going up ramp
    
        //VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);
//    for (unsigned int i = 0; i < 1; i++) {
        VECTOR3 rpos = CalcRelSurfPos(vhLC39[i], vs);
        sprintf(oapiDebugString(), "xdf %2.2fzdf %2.2f ydf %2.2f",  rpos.x, rpos.z, rpos.y);

        if (UpdateTouchdownPoints(rpos)) break;
    }


}
scn.
Code:
SLS_Pad:SLS\LP39PAD
  STATUS Landed Earth
  POS -80.6204210 28.6268820
  HEADING 0.00
  ALT 1.997
  AROT 61.696 4.478 8.250
  AFCMODE 7
  NAVFREQ 0 0
END
 
Last edited:

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
You're confusing the vessel name with the class name. This is from OrbiterConfig.pdf, p. 30. The code looks for the class name, not the vessel name. So you need to rename your cfg to SLS_Pad.cfg for it to work.

OrbiterScn_Vessels.jpg
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Ok I rename the cfg and scn.
Code:
SLS_Pad:SLS_Pad
  STATUS Landed Earth
  POS -80.6204210 28.6268820
  HEADING 0.00
  ALT 1.997
  AROT 61.696 4.478 8.250
  AFCMODE 7
  NAVFREQ 0 0
END

the same size. 0

the cfg:
MeshName = LP39
ClassName = SLS_Pad
Size = 200

BEGIN_ATTACHMENT
C 2 36.5 95.25 0 1 0 0 0 1 sp1
C 3.2 37.5 -6.1 0 1 0 0 0 1 sp2
C -111 38 -7 0 1 0 0 0 1 sp3
C -104 38.5 95 0 1 0 0 0 1 sp4
C -101 23.5 29.7 0 1 0 0 0 1 sp5
C 2.5 23 57 0 1 0 0 0 1 sp6
END_ATTACHMENT
 
Last edited:

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
Could you uncomment //oapiWriteLog("Found pad"); in FindLaunchPads? This way it will write to the orbiter.log file if it has found the pad. This will demonstrate if the code is actually doing something.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
I did
HTML:
000000.000: Module SLS_CRAWLER.dll ....... [Build 161025, API 160828]
000000.000: Finished initialising status
000000.000: Finished initialising camera
000000.000: Finished setting up render state
000000.000: Finished initialising panels
000000.000: Found pad

Got the lift animation correct:

CRAWLERELEVATED.jpg



So on the steering. So the trucks rotate 6 degrees either way, right? But looking at the drawings the tube do not, right?
Animating the rods might be the challenge as they are are part of the suspension.

---------- Post added at 05:15 PM ---------- Previous post was at 06:23 AM ----------

Ok. It see the hill. But look at the values;
Code:
-		rpos	{data=0x00a7fe28 {3.9993623854188532e+073, 0.00000000000000000, 3.9993623854188532e+073} x=3.9993623854188532e+073 ...}	VECTOR3
Code:
		VECTOR3 rpos = CalcRelSurfPos(vhLC39[i], vs);
crawlerdist.jpg


---------- Post added 10-26-16 at 06:05 AM ---------- Previous post was 10-25-16 at 05:15 PM ----------

Ok got the animations to work. I am going to make it so you can only steer when body is NOT extended.

But on the climbing the hill.

The code looks to see if you are on the hill
Code:
bool SLSCRAWLER::UpdateTouchdownPoints(const VECTOR3 &relPos)
{
	double front_dist, back_dist;
	double dist = length(relPos);
	double dCos = cos(lastHead);

	front_dist = dist - 20.0*abs(dCos);
	back_dist = dist + 20.0*abs(dCos);
//	sprintf(oapiDebugString(), "dist %2.2f  frtdist %2.2fbackdist %2.2f ", dist, front_dist, back_dist);

	// ramp to LC39 starts 390 m from pad and ends 131.5 m from pad
	if (front_dist < LC39_RAMP_START && abs(relPos.x)<10.0)
LC39_RAMP_START=392
Code:
-		relPos	{data=0x00a7fe28 {3.9993623854188532e+073, 0.00000000000000000, 3.9993623854188532e+073} x=3.9993623854188532e+073 ...}	const VECTOR3 &
dist=
Code:
		dist	5.6559525263041564e+073	double

Code:
		front_dist	5.6559525263041564e+073	double

Code:
		VECTOR3 rpos = CalcRelSurfPos(vhLC39[i], vs);
Code:
-		vhLC39	{ size=1 }	std::vector<void *,std::allocator<void *> >

So for some reason it shows the pad VERY far away

slscrawerturn.jpg

slscrawlerissue4.jpg


---------- Post added 10-27-16 at 05:58 AM ---------- Previous post was 10-26-16 at 06:05 AM ----------

So Here is I see the process.
Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {
	if (!firstTimestepDone) DoFirstTimestep();


	// check distance from pads; adjust touchdown points to simulate going up ramp
	for (unsigned int i = 0; i<vhLC39.size(); i++) {
		
	// check distance from pads; adjust touchdown points to simulate going up ramp
	
		//VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);
//	for (unsigned int i = 0; i < 1; i++) {
	rpos = CalcRelSurfPos(vhLC39[i], vs);
		sprintf(oapiDebugString(), "xdf %2.2fzdf %2.2f ydf %2.2f",  rpos.x, rpos.z, rpos.y);

		if (UpdateTouchdownPoints(rpos)) break;
	}


}
Code:
void SLSCRAWLER::DoFirstTimestep() {

	//SetView();

	FindLaunchpads();
	hEarth = GetGravityRef();

	//oapiGetHeading(GetHandle(), &targetHeading);

	//if (!standalone) {
	//	hMLP = GetAttachmentStatus(ahMLP);
	//	if (hMLP) {
	//		// find point on MLP we are attached to
	//		VESSEL* pMLP = oapiGetVesselInterface(hMLP);
	//		for (DWORD i = 0; i<pMLP->AttachmentCount(true); i++) {
	//			ATTACHMENTHANDLE aH = pMLP->GetAttachmentHandle(true, i);
	//			if (pMLP->GetAttachmentStatus(aH) == GetHandle()) hMLPAttach = aH;
	//		}
	//	}
	//}
	firstTimestepDone = true;
}
void SLSCRAWLER::FindLaunchpads()
{
	for (DWORD i = 0; i<oapiGetVesselCount(); i++) {
		OBJHANDLE hVessel = oapiGetVesselByIndex(i);
		if (hVessel && !_strnicmp(oapiGetVesselInterface(hVessel)->GetClassName(), "SLS_Pad", 7)) {
			vhLC39.push_back(hVessel);
			oapiWriteLog("Found pad");
		}
	}
}

So find launchpads.
So here is the values it comes back for relpos:
Code:
+		relPos	{data=0x05c5f7f0 {3.9993623854188532e+073, 0.00000000000000000, 3.9993623854188532e+073} x=3.9993623854188532e+073 ...}	const VECTOR3 &

Even though I move the crawler no change.

so then it checks to see if the vessel is near the edge of the pad
Code:
bool SLSCRAWLER::UpdateTouchdownPoints(const VECTOR3 &relPos)
{
	double front_dist, back_dist;
	double dist = length(relPos);
	double dCos = cos(lastHead);

	front_dist = dist - 20.0*abs(dCos);
	back_dist = dist + 20.0*abs(dCos);
//	sprintf(oapiDebugString(), "dist %2.2f  frtdist %2.2fbackdist %2.2f ", dist, front_dist, back_dist);

	// ramp to LC39 starts 390 m from pad and ends 131.5 m from pad
	if (front_dist < LC39_RAMP_START && abs(relPos.x)<10.0)

Code:
		dist	5.6559525263041564e+073	double

So it will not change the touchdowns since it doesn't think it is near the pad.

Not sure how to fix.


Code:
VECTOR3 SLSCRAWLER::CalcRelSurfPos(OBJHANDLE hVessel, const VESSELSTATUS2& vs) const
{
	double padLat, padLong, padRad;
	oapiGetEquPos(hVessel, &padLong, &padLat, &padRad);
	return _V(padLong*oapiGetSize(hEarth) - vs.surf_lng*oapiGetSize(hEarth), 0.0, padLat*oapiGetSize(hEarth) - vs.surf_lat*oapiGetSize(hEarth));
}
Code:
		surf_lng	-6.2774385622041925e+066	double
		surf_lat	-6.2774385622041925e+066	double
Code:
		padLong	-9.2559631349317831e+061	double
		padRad	-9.2559631349317831e+061	double
		padLat	-9.2559631349317831e+061	double

So look at the lat and long they are the same?
 
Last edited:

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Hey Gattispilot,

I can't help you with that sorry. :eek:h:But do you know how I can solve this? For the SLS 1b I'm sending Orion and a hab module to space. The Orion detaches from the upperstage, moves out of the way for Universal Stage Adapter jettison and after this I want the Orion to dock to the hab module which is a payload of the SLS/EUS.

Problem is the hab module is attached to the EUS and it seems impossible to dock to the Orion with the hab. I get the docking sound confirming dock but it still floats freely around. Now I've read that this probably because the hab is a child attachment to the EUS and docking to a child is buggy. Is this correct?

I thought about making a docking port to the EUS so the hab can be docked to the EUS and the Orion would have no problem docking to the hab. But with Multistage I'm not sure where to begin and if I can make this work.

Must a module be made for the EUS to add a docking port to solve this issue?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Well Can you detach the hab from the EUS. Well I think in the cfg you can add a docking port
 

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Thanks but I don't want to detach the hab from the EUS. It has to stay connected. I want to build a stack for manned deep space exploration. For now: EUS>Hab>Orion
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Well I would dock with the Hab. and then exit. The scn should show it docked.

---------- Post added at 05:28 PM ---------- Previous post was at 02:57 PM ----------

So if I put this in the prestep in debug I get a break
Code:
if (vs.status == 1) {
        lon = vs.surf_lng;
        lat = vs.surf_lat;
        lastHead = vs.surf_hdg;
    }
    else if (lastLatLongSet) {
        lon = lastLong;
        lat = lastLat;
        vs.surf_hdg = lastHead;

    }
    else return;
I am not sure why the padlong,padlat and pad rad are all the same number?

Code:
VECTOR3 SLSCRAWLER::CalcRelSurfPos(OBJHANDLE hVessel, const VESSELSTATUS2& vs) const
{
    double padLat, padLong, padRad;
    oapiGetEquPos(hVessel, &padLong, &padLat, &padRad);
    return _V(padLong*oapiGetSize(hEarth) - vs.surf_lng*oapiGetSize(hEarth), 0.0, padLat*oapiGetSize(hEarth) - vs.surf_lat*oapiGetSize(hEarth));
}
I put a break in and get:
padLong -1.4070917907939793 double
padRad 6371016.9970000004 double
padLat 0.49963334547989935 double

but the vs.surf info is;
surf_lng -6.2774385622041925e+066 double
surf_lat -6.2774385622041925e+066 double
surf_hdg -6.2774385622041925e+066 double


dir
+ data 0x00a7fe34 {0.99999563961671489, 0.0029530911867491974, 0.00000000000000000} double[3]
x 0.99999563961671489 double
y 0.0029530911867491974 double
z 0.00000000000000000 double


lat -6.2774385622041925e+066 double
lon -6.2774385622041925e+066 double

lastLat -6.2774385622041925e+066 double
lastLong -6.2774385622041925e+066 double
lastHead -6.2774385622041925e+066 double


Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {
    if (!firstTimestepDone) DoFirstTimestep();

    //double lat, lon;
    //vs.version = 2;
    //GetStatusEx(&vs);
//
     
        //lon = vs.surf_lng;
        //lat = vs.surf_lat;
    //    lastHead = vs.surf_hdg;
    
        VECTOR3 dir = _V(sin(lastHead ), cos(lat) * cos(lastHead ), 0);
        dir /= length(dir);
        lon += dir.x * simdt / oapiGetSize(hEarth);
        lat += dir.y *  simdt / oapiGetSize(hEarth);
        vs.surf_lng = lon;
        vs.surf_lat = lat;
        vs.status = 1;
        DefSetStateEx(&vs);

        lastLat = lat;
        lastLong = lon;
        lastHead = vs.surf_hdg;
        lastLatLongSet = true;






    // check distance from pads; adjust touchdown points to simulate going up ramp
    for (unsigned int i = 0; i<vhLC39.size(); i++) {
        
    // check distance from pads; adjust touchdown points to simulate going up ramp
    
        //VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);
//    for (unsigned int i = 0; i < 1; i++) {
    rpos = CalcRelSurfPos(vhLC39[i], vs);
        sprintf(oapiDebugString(), "xdf %2.2fzdf %2.2f ydf %2.2f",  rpos.x, rpos.z, rpos.y);

        if (UpdateTouchdownPoints(rpos)) break;
    }


}
So it should get the pad long and lat and rad and see how far it is away from the crawler Not sure why that is not working

---------- Post added 10-28-16 at 05:42 AM ---------- Previous post was 10-27-16 at 05:28 PM ----------

Well I added more code when i run the debugger I get a break.
Code:
double lat, lon;
    vs.version = 2;
    GetStatusEx(&vs);

    if (vs.status == 1) {
        lon = vs.surf_lng;
        lat = vs.surf_lat;
        lastHead = vs.surf_hdg;
    }
    else if (lastLatLongSet) {
        lon = lastLong;
        lat = lastLat;
        vs.surf_hdg = lastHead;

    }
    else return;
crawlercodebreak.jpg

crawlercodebreak1.jpg


here is the prestep code:
Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {
	if (!firstTimestepDone) DoFirstTimestep();

	//double lat, lon;
	//vs.version = 2;
	//GetStatusEx(&vs);
//
	 
		//lon = vs.surf_lng;
		//lat = vs.surf_lat;
	//	lastHead = vs.surf_hdg;
	double lat, lon;
	vs.version = 2;
	GetStatusEx(&vs);

	if (vs.status == 1) {
		lon = vs.surf_lng;
		lat = vs.surf_lat;
		lastHead = vs.surf_hdg;
	}
	else if (lastLatLongSet) {
		lon = lastLong;
		lat = lastLat;
		vs.surf_hdg = lastHead;

	}
	else return;


		//new stuff

		const double r = 127; // 150 ft
		double dheading = ((steeringActual[1] - steeringActual[0]) * currentSpeed * simdt) / (2 * r);
		vs.surf_hdg += dheading;
		if (vs.surf_hdg< 0) vs.surf_hdg += 2.0 * PI;
		if (vs.surf_hdg >= 2.0 * PI) vs.surf_hdg -= 2.0 * PI;

		double headingOffset = -(steeringActual[1] + steeringActual[0]) * MAX_TURN_ANGLE / 2.0;
		VECTOR3 dir = _V(sin(lastHead + headingOffset), cos(lat) * cos(lastHead + headingOffset), 0);
		dir /= length(dir);
		lon += dir.x * currentSpeed * simdt / oapiGetSize(hEarth);
		lat += dir.y * currentSpeed * simdt / oapiGetSize(hEarth);
		vs.surf_lng = lon;
		vs.surf_lat = lat;
		vs.status = 1;
		DefSetStateEx(&vs);

		lastLat = lat;
		lastLong = lon;
		lastHead = vs.surf_hdg;
		lastLatLongSet = true;



	// check distance from pads; adjust touchdown points to simulate going up ramp
	for (unsigned int i = 0; i<vhLC39.size(); i++) {
		
	// check distance from pads; adjust touchdown points to simulate going up ramp
	
		//VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);
//	for (unsigned int i = 0; i < 1; i++) {
	rpos = CalcRelSurfPos(vhLC39[i], vs);
		sprintf(oapiDebugString(), "xdf %2.2fzdf %2.2f ydf %2.2f",  rpos.x, rpos.z, rpos.y);

		if (UpdateTouchdownPoints(rpos)) break;
	}


}
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
I may be done with this.
What we need is to figure the pad location, crawler and get a distance.
this should do it but the vs.surf.lat and log are all the same.
Code:
VECTOR3 SLSCRAWLER::CalcRelSurfPos(OBJHANDLE hVessel, const VESSELSTATUS2& vs) const
{
	double padLat, padLong, padRad;
	oapiGetEquPos(hVessel, &padLong, &padLat, &padRad);
	return _V(padLong*oapiGetSize(hEarth) - vs.surf_lng*oapiGetSize(hEarth), 0.0, padLat*oapiGetSize(hEarth) - vs.surf_lat*oapiGetSize(hEarth));
}

So that is messing with the distance
 

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Hey guys, is this compatible with Orbiter 2010?

Ha, I noticed the link was dead. I've updated it.

I just tested it and it is. Well, sort of. :) The particle streams are enormously big in my version. Also the location of the launchpad is off. I'll have to sort that out.

Make sure you remove the 2016 Vesta planet from the SLS_Sol.cfg in the config folder, and number the planets correct after removal. Also download the latest D3D9 client of Jarmonik for 2010 to make it work. http://d3d9client.codeplex.com/releases/view/598601

And of course download the 2010 version of Multistage2015 in stead of 2016 version.

I'll make a zip for 2010 Orbiter for the people who want to use it in 2010.
 
Last edited:

romanasul

Member
Joined
May 5, 2012
Messages
301
Reaction score
0
Points
16
Location
Toronto
Ha, I noticed the link was dead. I've updated it.

I just tested it and it is. Well, sort of. :) The particle streams are enormously big in my version. Also the location of the launchpad is off. I'll have to sort that out.

Make sure you remove the 2016 Vesta planet from the SLS_Sol.cfg in the config folder, and number the planets correct after removal. Also download the latest D3D9 client of Jarmonik for 2010 to make it work. http://d3d9client.codeplex.com/releases/view/598601

And of course download the 2010 version of Multistage2015 in stead of 2016 version.

I'll make a zip for 2010 Orbiter for the people who want to use it in 2010.

Thanks, I noticed Vesta problem when it first crashed. For me, I'll continue to use Orbiter 2010 until Ummu starts working for 2016 and more addons are supported.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
ok I thought I had progress as the crawler was spinning around. So I started to debug. But I get a break right after the arrow.

SLSBREAK.jpg

Code:
		vs	{version=2 flag=3452816845 rbody=0xcdcdcdcd ...}	VESSELSTATUS2
		version	2	unsigned long
		flag	3452816845	unsigned long
		rbody	0xcdcdcdcd	void *
		base	0xcdcdcdcd	void *
		port	-842150451	int
		status	-842150451	int


Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {

	//double maxVelocity = 0.894;

	if (!firstTimestepDone) DoFirstTimestep();

	//if(IsAttached()) pEngine->SetMaxSpeed(MAX_LOADED_SPEED);
	//else pEngine->SetMaxSpeed(MAX_UNLOADED_SPEED);
	//pEngine->OnPreStep(simt, simdt, mjd);

	//if (IsAttached()) maxVelocity = maxVelocity / 2.0;

	// set target speed


	double lat, lon;
	vs.version = 2;
	GetStatusEx(&vs);

	if (vs.status == 1) {
		lon = vs.surf_lng;
		lat = vs.surf_lat;
		lastHead = vs.surf_hdg;
	}
	else if (lastLatLongSet) {
		lon = lastLong;
		lat = lastLat;
		vs.surf_hdg = lastHead;

	}
	else return;



	const double r = 127; // 150 ft
	double dheading = ((steeringActual[1] - steeringActual[0]) * currentSpeed * simdt) / (2 * r);
	vs.surf_hdg += dheading;
	if (vs.surf_hdg< 0) vs.surf_hdg += 2.0 * PI;
	if (vs.surf_hdg >= 2.0 * PI) vs.surf_hdg -= 2.0 * PI;

	double headingOffset = -(steeringActual[1] + steeringActual[0]) * MAX_TURN_ANGLE / 2.0;
	VECTOR3 dir = _V(sin(lastHead + headingOffset), cos(lat) * cos(lastHead + headingOffset), 0);
	dir /= length(dir);
	lon += dir.x * currentSpeed * simdt / oapiGetSize(hEarth);
	lat += dir.y * currentSpeed * simdt / oapiGetSize(hEarth);
	vs.surf_lng = lon;
	vs.surf_lat = lat;
	vs.status = 1;
	DefSetStateEx(&vs);

	lastLat = lat;
	lastLong = lon;
	lastHead = vs.surf_hdg;
	lastLatLongSet = true;
	//targetHeading = lastHead;

	// check distance from pads; adjust touchdown points to simulate going up ramp
		
	for (unsigned int i = 0; i<vhLC39.size(); i++) {
		//VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);

		VECTOR3 rpos = CalcRelSurfPos(vhLC39[i], vs);

		if (UpdateTouchdownPoints(rpos)) break;
	}




}
 
Top