Project Updated SLS for Orbiter 2016 (and 2010)

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Thanks.

Code:
MATRIX3 SLSCRAWLER::RotationMatrix(VECTOR3 angles, bool xyz)
{
	MATRIX3 m;
	MATRIX3 RM_X, RM_Y, RM_Z;
	RM_X = _M(1, 0, 0, 0, cos(angles.x), -sin(angles.x), 0, sin(angles.x), cos(angles.x));
	RM_Y = _M(cos(angles.y), 0, sin(angles.y), 0, 1, 0, -sin(angles.y), 0, cos(angles.y));
	RM_Z = _M(cos(angles.z), -sin(angles.z), 0, sin(angles.z), cos(angles.z), 0, 0, 0, 1);
	if (!xyz)
	{
		m = mul(RM_Z, mul(RM_Y, RM_X));
	}
	else{
		m = mul(RM_X, mul(RM_Y, RM_Z));
	}
	return m;
}




void SLSCRAWLER::MoveAround(bool FWD, bool BWD, bool LFT, bool RGT){
	if (FWD)
	{

		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);

		double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
		double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
		vs2.surf_lat += d_lat*RAD;
		vs2.surf_lng += d_lng*RAD;


		MATRIX3 rot1 = RotationMatrix(_V(0, (90 * DEG - vs2.surf_lng), 0 * DEG), TRUE);
		MATRIX3 rot2 = RotationMatrix(_V((-Lat)*DEG, 0, 0 * DEG), TRUE);
		MATRIX3 RotMatrix_Def = mul(rot1, rot2);
		vs2.arot.x = atan2(RotMatrix_Def.m23, RotMatrix_Def.m33);
		vs2.arot.y = -asin(RotMatrix_Def.m13);
		vs2.arot.z = atan2(RotMatrix_Def.m12, RotMatrix_Def.m11);
		DefSetStateEx(&vs2);
		return;
	}

she moves put she now points up and at angle. But she will move forward and back. On left and right spins on x axis

3j2KQT4.jpg


---------- Post added at 05:14 AM ---------- Previous post was at 05:01 AM ----------

N3PuseX.jpg

17.62.2.6 doubleVESSELSTATUS2::surf_lng
longitude of vessel position in equatorial coordinates of rbody [rad]
Note
currently only defined if the vessel is landed (status=1)
The documentation for this struct was generated from the following file:
• Orbitersdk/include/OrbiterAPI.h

NEW CODE:
Code:
MATRIX3 SLSCRAWLER::RotationMatrix(VECTOR3 angles, bool xyz)
{
	MATRIX3 m;
	MATRIX3 RM_X, RM_Y, RM_Z;
	RM_X = _M(1, 0, 0, 0, cos(angles.x), -sin(angles.x), 0, sin(angles.x), cos(angles.x));
	RM_Y = _M(cos(angles.y), 0, sin(angles.y), 0, 1, 0, -sin(angles.y), 0, cos(angles.y));
	RM_Z = _M(cos(angles.z), -sin(angles.z), 0, sin(angles.z), cos(angles.z), 0, 0, 0, 1);
	if (!xyz)
	{
		m = mul(RM_Z, mul(RM_Y, RM_X));
	}
	else{
		m = mul(RM_X, mul(RM_Y, RM_Z));
	}
	return m;
}




void SLSCRAWLER::MoveAround(bool FWD, bool BWD, bool LFT, bool RGT){
	if (FWD)
	{

		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);

		double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
		double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
		vs2.surf_lat += d_lat*RAD;
		vs2.surf_lng += d_lng*RAD;


		MATRIX3 rot1 = RotationMatrix(_V(0, (90 * RAD - vs2.surf_lng), 0 * RAD), TRUE);
		MATRIX3 rot2 = RotationMatrix(_V((-Lat)*RAD, 0, 0 * RAD), TRUE);
		MATRIX3 RotMatrix_Def = mul(rot1, rot2);
		vs2.arot.x = atan2(RotMatrix_Def.m23, RotMatrix_Def.m33);
		vs2.arot.y = -asin(RotMatrix_Def.m13);
		vs2.arot.z = atan2(RotMatrix_Def.m12, RotMatrix_Def.m11);
		DefSetStateEx(&vs2);
		return;
	}

SCN:
CRAWL:SLSCRAWLER
STATUS Landed Earth
POS -80.6758980 28.5199647
HEADING 180.00
ALT 0.000
AROT -176.509 -9.307 179.435
AFCMODE 7
NAVFREQ 0 0
END
 
Last edited:

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
105
Points
78
Code:
MATRIX3 rot2 = RotationMatrix(_V((-Lat)*RAD, 0, 0 * RAD), TRUE);

wrong.

it will point up anyway, you will have to add a rotation around x axis.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Thanks.

So rot 2 controls the x axis? But the vessel pointing up would be on the y, right.

Rot 1 seems to control the y axis.

rot 1 changes long
rot 2 changes lat
correct?
So You said I need to add a rotation around the x axis, not sure what that would look like? rot3?
 
Last edited:

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
105
Points
78
you have to study a bit rotation matrixes, it's not so easy, because the order of how rotations are applied changes the result.

rot 1 changes applies a rotation so the vessel will be correctly oriented at that longitude, rot 2 does the same for latitude. but that is built for a vessel pointing the nose up, so there should be another rotation. if it's applied before or later that changes a lot of things, also on respect to heading. I will have to study that for the MS2015 crawler, but it takes some reasoning to get the result, I don't know immediatly

So rot 2 controls the x axis? But the vessel pointing up would be on the y, right.

rotation should be made around x axis to have it correctly pointed. but that's achievable also by rotating around y 90deg and then around z other 90 deg... it's a very tricky topic
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Ok Thanks. What if I just rotate the mesh 90 degrees. So the mesh will be level when moving.

Away from a PC now. But will try some thing
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
105
Points
78
Ok Thanks. What if I just rotate the mesh 90 degrees. So the mesh will be level when moving.

Away from a PC now. But will try some thing

you can do that, and remember to rotate also the cockpit direction.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Do you mean the camera direction?

But the left and right still spin.

Thanks

---------- Post added at 09:38 AM ---------- Previous post was at 08:16 AM ----------

Well I guess I could use thrust/force to move her. But then it becomes an issue of telling how far the launch pad is from the crawler.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
105
Points
78
Do you mean the camera direction?

But the left and right still spin.

Thanks

---------- Post added at 09:38 AM ---------- Previous post was at 08:16 AM ----------

Well I guess I could use thrust/force to move her. But then it becomes an issue of telling how far the launch pad is from the crawler.

yes camera direction inside the vehicle. No thrust is needed, the whole thing here is to have a stable movement without applying forces which will make it unstable...
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
ok. Well I will rotate the mesh 90 degrees out. That should fix the forward and back. But I will look at the left/ right. So before if the direction was 0,0,0 it will be 0,1,0?

If this works I can change the attachment also.
Thanks
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
105
Points
78
ok. Well I will rotate the mesh 90 degrees out. That should fix the forward and back. But I will look at the left/ right. So before if the direction was 0,0,0 it will be 0,1,0?

If this works I can change the attachment also.
Thanks

the direction 0,0,0 does not exist. it's a null vector.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
I meant 0,0,1 for the default camera

---------- Post added at 02:33 PM ---------- Previous post was at 12:34 PM ----------

Ok. I rotated the mesh.

But it still is not level.
Do I need to change the orientation in the touchdown points?
Code:
	SetTouchdownPoints(_V(0, .001, 20), _V(-15, .001, -20), _V(15, .001, -20));;
GpgKwJ8.jpg

Code:
MATRIX3 SLSCRAWLER::RotationMatrix(VECTOR3 angles, bool xyz)
{
	MATRIX3 m;
	MATRIX3 RM_X, RM_Y, RM_Z;
	RM_X = _M(1, 0, 0, 0, cos(angles.x), -sin(angles.x), 0, sin(angles.x), cos(angles.x));
	RM_Y = _M(cos(angles.y), 0, sin(angles.y), 0, 1, 0, -sin(angles.y), 0, cos(angles.y));
	RM_Z = _M(cos(angles.z), -sin(angles.z), 0, sin(angles.z), cos(angles.z), 0, 0, 0, 1);
	if (!xyz)
	{
		m = mul(RM_Z, mul(RM_Y, RM_X));
	}
	else{
		m = mul(RM_X, mul(RM_Y, RM_Z));
	}
	return m;
}




void SLSCRAWLER::MoveAround(bool FWD, bool BWD, bool LFT, bool RGT){
	if (FWD)
	{

		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);

		double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
		double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
		vs2.surf_lat += d_lat*RAD;
		vs2.surf_lng += d_lng*RAD;


		MATRIX3 rot1 = RotationMatrix(_V(0, (90 * RAD - vs2.surf_lng), 0 * RAD), TRUE);
		MATRIX3 rot2 = RotationMatrix(_V((-Lat)*RAD, 0, 0 * RAD), TRUE);
		MATRIX3 RotMatrix_Def = mul(rot1, rot2);
		vs2.arot.x = atan2(RotMatrix_Def.m23, RotMatrix_Def.m33);
		vs2.arot.y = -asin(RotMatrix_Def.m13);
		vs2.arot.z = atan2(RotMatrix_Def.m12, RotMatrix_Def.m11);
		DefSetStateEx(&vs2);
		return;
	}

Rather than alter the mesh. Could I just adapt your hack for the ms crawler

---------- Post added 11-19-16 at 07:37 AM ---------- Previous post was 11-18-16 at 02:33 PM ----------

The 2010 Crawler works good.

On the 2016 since fred's ms crawler not sure if I couldn't just use his hack.

As far as thrust goes. I have a sc4 version and it does good. BUT then the 2nd part comes into play. Determining how far from the launchpad comes into play.
 
Last edited:

Loopos

Procrastination Master
Joined
Sep 17, 2016
Messages
38
Reaction score
9
Points
8
Try these textures and overwrite the previous files. See if it resolves the bug. Let me know if it works. Thanks! -Longjap
Hi Longjap thx for the textures sorry but the textures don't really work,they just make the game crashing more frequent with your scenarios.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Ok. I got the slscrawler to move in 2016 using Fred's hack.

But now to get her to climb. I think the issue might be using different vs version?

Code:
if (FWD)
		{

			VESSELSTATUS2 vs2;
			memset(&vs2, 0, sizeof(vs2));
			vs2.version = 2;
			GetStatusEx(&vs2);

			double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
			double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
			vs2.surf_lat += d_lat*RAD;
			vs2.surf_lng += d_lng*RAD;

			if (oapiGetOrbiterVersion()<160903)
			{
				FILEHANDLE fh = oapiOpenFile("SLSCRAWLER", FILE_OUT, CONFIG);
				oapiWriteScenario_string(fh, "STATUS", "Landed Earth");
				oapiWriteScenario_float(fh, "HEADING", vs2.surf_hdg*DEG);
				char position[256];
				sprintf(position, "%.20f %.20f", vs2.surf_lng*DEG, vs2.surf_lat*DEG);
				oapiWriteScenario_string(fh, "POS", position);
				oapiCloseFile(fh, FILE_OUT);
				fh = oapiOpenFile("SLSCRAWLER", FILE_IN, CONFIG);
				clbkLoadStateEx(fh, &vs2);
				oapiCloseFile(fh, FILE_IN);
			}
			DefSetStateEx(&vs2);
			return;
		}

So not to see if we are near the pad:
Code:
void SLSCRAWLER::clbkPreStep(double simt, double simdt, double mjd) {

	MoveAround(FWD, BWD, LFT, RGT);
	if (!firstTimestepDone) DoFirstTimestep();
	for (unsigned int i = 0; i<vhLC39.size(); i++) {
		//VESSEL* pV=oapiGetVesselInterface(vhLC39[i]);

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

		if (UpdateTouchdownPoints(rpos)) break;
	}
}
rpos comes up as 0,0,0


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:
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);
	//	sprintf(oapiDebugString(), "distdf %2.2f rel_Xdf %2.2f", front_dist, relPos.x);
	// 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)
	{

dist -9.2559631349317831e+061 double
x 3.9993623854188532e+073 double
y 0.00000000000000000 double
z 3.9993623854188532e+073 double

---------- Post added 11-21-16 at 05:39 AM ---------- Previous post was 11-20-16 at 07:03 AM ----------

oK. I have this. It now reads the dist from the pad.
Code:
VECTOR3 SLSCRAWLER::CalcRelSurfPos(OBJHANDLE hVessel, const VESSELSTATUS2& vs) const
{
	double padLat, padLong, padRad;
	VESSELSTATUS2 vs2;
	memset(&vs2, 0, sizeof(vs2));
	vs2.version = 2;
	GetStatusEx(&vs2);


	oapiGetEquPos(hVessel, &padLong, &padLat, &padRad);

	return _V(padLong*oapiGetSize(hEarth) - vs2.surf_lng*oapiGetSize(hEarth), 0.0, padLat*oapiGetSize(hEarth) - vs2.surf_lat*oapiGetSize(hEarth));
}

padLat 0.49930126168312244 double
padLong -1.4068026071902164 double
vs2.surf_lat 0.49922966185694084 double
vs2.surf_lng -1.4068061905913325 double
dist 456.73414203496071 double

I have a break here
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);
	//	sprintf(oapiDebugString(), "distdf %2.2f rel_Xdf %2.2f", front_dist, relPos.x);
	// 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)
if I continue I get a hard break.
OZFFELG.jpg

If I run this in non debug I get a ctd.
Code:
void SLSCRAWLER::MoveAround(bool FWD, bool BWD, bool LFT, bool RGT){
	

		if (FWD)
		{

			VESSELSTATUS2 vs2;
			memset(&vs2, 0, sizeof(vs2));
			vs2.version = 2;
			GetStatusEx(&vs2);

			double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
			double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
			vs2.surf_lat += d_lat*RAD;
			vs2.surf_lng += d_lng*RAD;
			
			if (oapiGetOrbiterVersion()<160903)
			{
				FILEHANDLE fh = oapiOpenFile("SLSCRAWLER", FILE_OUT, CONFIG);
				oapiWriteScenario_string(fh, "STATUS", "Landed Earth");
				oapiWriteScenario_float(fh, "HEADING", vs2.surf_hdg*DEG);
				char position[256];
				sprintf(position, "%.20f %.20f", vs2.surf_lng*DEG, vs2.surf_lat*DEG);
				oapiWriteScenario_string(fh, "POS", position);
				oapiCloseFile(fh, FILE_OUT);
				fh = oapiOpenFile("SLSCRAWLER", FILE_IN, CONFIG);
				clbkLoadStateEx(fh, &vs2);
				oapiCloseFile(fh, FILE_IN);
			}
			lastHead = vs2.surf_hdg;

			DefSetStateEx(&vs2);
			return;
		}
	

	if (BWD){
		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);

		double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
		double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
		vs2.surf_lat -= d_lat*RAD;
		vs2.surf_lng -= d_lng*RAD;

		if (oapiGetOrbiterVersion()<160903)
		{
			FILEHANDLE fh = oapiOpenFile("SLSCRAWLER", FILE_OUT, CONFIG);
			oapiWriteScenario_string(fh, "STATUS", "Landed Earth");
			oapiWriteScenario_float(fh, "HEADING", vs2.surf_hdg*DEG);
			char position[256];
			sprintf(position, "%.20f %.20f", vs2.surf_lng*DEG, vs2.surf_lat*DEG);
			oapiWriteScenario_string(fh, "POS", position);
			oapiCloseFile(fh, FILE_OUT);
			fh = oapiOpenFile("SLSCRAWLER", FILE_IN, CONFIG);
			clbkLoadStateEx(fh, &vs2);
			oapiCloseFile(fh, FILE_IN);
		}
		lastHead = vs2.surf_hdg;

		DefSetStateEx(&vs2);
		return;
	}

	if (LFT)
	{
		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);
		double d_hdg = AngSpeed*oapiGetSimStep();
		vs2.surf_hdg -= d_hdg;

		if (vs2.surf_hdg<0){ vs2.surf_hdg += 2 * PI; }



		if (oapiGetOrbiterVersion()<160903)
		{
			FILEHANDLE fh = oapiOpenFile("SLSCRAWLER", FILE_OUT, CONFIG);
			oapiWriteScenario_string(fh, "STATUS", "Landed Earth");
			oapiWriteScenario_float(fh, "HEADING", vs2.surf_hdg*DEG);
			char position[256];
			sprintf(position, "%.20f %.20f", vs2.surf_lng*DEG, vs2.surf_lat*DEG);
			oapiWriteScenario_string(fh, "POS", position);
			oapiCloseFile(fh, FILE_OUT);
			fh = oapiOpenFile("SLSCRAWLER", FILE_IN, CONFIG);
			clbkLoadStateEx(fh, &vs2);
			oapiCloseFile(fh, FILE_IN);
		}
		lastHead = vs2.surf_hdg;

		DefSetStateEx(&vs2);
		return;
	}


	if (RGT)
	{
		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);
		double d_hdg = AngSpeed*oapiGetSimStep();
		vs2.surf_hdg += d_hdg;

		if (vs2.surf_hdg>2 * PI){ vs2.surf_hdg -= 2 * PI; }



		if (oapiGetOrbiterVersion()<160903)
		{
			FILEHANDLE fh = oapiOpenFile("SLSCRAWLER", FILE_OUT, CONFIG);
			oapiWriteScenario_string(fh, "STATUS", "Landed Earth");
			oapiWriteScenario_float(fh, "HEADING", vs2.surf_hdg*DEG);
			char position[256];
			sprintf(position, "%.20f %.20f", vs2.surf_lng*DEG, vs2.surf_lat*DEG);
			oapiWriteScenario_string(fh, "POS", position);
			oapiCloseFile(fh, FILE_OUT);
			fh = oapiOpenFile("SLSCRAWLER", FILE_IN, CONFIG);
			clbkLoadStateEx(fh, &vs2);
			oapiCloseFile(fh, FILE_IN);
		}
		lastHead = vs2.surf_hdg;

		DefSetStateEx(&vs2);
		return;
	}
	return;
}


---------- Post added at 06:04 AM ---------- Previous post was at 05:39 AM ----------

On further debugging it seems to break here?
Code:
	curFrontHeight	0.010000000000000000	double
		jackHeight	0.00000000000000000	double
		newytouch	0.010000000000000000	double
	SetTouchdownPoints(_V(0, jackHeight + curFrontHeight, 20.0), _V(-15, jackHeight + curFrontHeight, -20.0), _V(15, jackHeight + curFrontHeight, -20.0));;
 
Last edited:

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Hi Longjap thx for the textures sorry but the textures don't really work,they just make the game crashing more frequent with your scenarios.

Hmm, but it's not very clear to me if the EUS shows up now i.e. no transparent textures any more?
I experience some instability too with the scenario's but only if I reload them. Not when clean from the start.

Can you post the log file to check what's going on?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Can you tell us which scenario also?

---------- Post added 11-22-16 at 06:03 AM ---------- Previous post was 11-21-16 at 08:34 AM ----------

well I get a CTD on the non orion launches. The Block II and block ib

============================ ERROR: ===========================
Mesh not found: .\Meshes\SLS\adapter.msh
[MeshManager::LoadMesh | .\Mesh.cpp | 1238]
===============================================================

============================ ERROR: ===========================
Mesh not found: .\Meshes\.msh
[LoadMesh | .\Mesh.cpp | 1269]
===============================================================

On the crawler I can detect the pad:)
 
Last edited:

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Thx, I think you're using an older scenario from previous versions. I don't see any calls for the SLS/adapter.msh in the config for the new block Ib cargo. Only the two scenario's (EM1, SLS Block 1b Cargo) given in the last download are expected to work. Not the older ones.
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Ok. On the SLS Block 1b Cargo I see no rocket. Nothing in the log
Code:
000012.146: **** Creating simulation session
000012.146: DirectDraw interface OK
000012.146: Direct3D interface OK
000012.146: Graphics: Viewport: Window 1914 x 1051 x 32
000012.146: Graphics: Hardware T&L capability: Yes
000012.146: Graphics: Z-buffer depth: 32 bit
000012.146: Graphics: Active lights supported: 8
000012.146: Loading 15382 records from star database
000012.146: ---------------------------------------------------------------
000012.146: >>> ERROR: DDraw error DDERR_BLTFASTCANTCLIP
000012.146: >>> [OrbiterGraphics::clbkBlt | .\OGraphics.cpp | 1633]
000012.146: ---------------------------------------------------------------
000000.000: Module Sun.dll ............... [Build 160828, API 160828]
VSOP87(E) Sun: Precision 1e-006, Terms 554/6634
000000.000: Module Mercury.dll ........... [Build 160828, API 160828]
VSOP87(B) Mercury: Precision 1e-005, Terms 167/7123
000000.000: Module Venus.dll ............. [Build 160828, API 160828]
000000.000: Module VenusAtm2006.dll ...... [Build 160828, API 160828]
VSOP87(B) Venus: Precision 1e-005, Terms 79/1710
000000.000: Module Earth.dll ............. [Build 160828, API 160828]
000000.000: Module EarthAtmJ71G.dll ...... [Build 160828, API 160828]
VSOP87(B) Earth: Precision 1e-008, Terms 2564/2564
000000.000: BaseObject: Parse error
000000.000: Module Moon.dll .............. [Build 160828, API 160828]
ELP82: Precision 1e-005, Terms 116/829
000000.000: Module Mars.dll .............. [Build 160828, API 160828]
000000.000: Module MarsAtm2006.dll ....... [Build 160828, API 160828]
VSOP87(B) Mars: Precision 1e-005, Terms 405/6400
000000.000: Module Phobos.dll ............ [Build ******, API 060425]
000000.000: Module Deimos.dll ............ [Build ******, API 060425]
000000.000: Module Galsat.dll ............ [Build 160828, API 160828]
000000.000: Module Jupiter.dll ........... [Build 160828, API 160828]
VSOP87(B) Jupiter: Precision 1e-006, Terms 1624/3625
000000.000: Module Io.dll ................ [Build 160828, API 160828]
000000.000: Module Europa.dll ............ [Build 160828, API 160828]
000000.000: Module Ganymede.dll .......... [Build 160828, API 160828]
000000.000: Module Callisto.dll .......... [Build 160828, API 160828]
000000.000: Module Satsat.dll ............ [Build 160828, API 160828]
000000.000: Module Saturn.dll ............ [Build 160828, API 160828]
VSOP87(B) Saturn: Precision 1e-006, Terms 2904/6365
000000.000: Module Mimas.dll ............. [Build 160828, API 160828]
SATSAT Mimas: Terms 113
000000.000: Module Enceladus.dll ......... [Build 160828, API 160828]
SATSAT Enceladus: Terms 33
000000.000: Module Tethys.dll ............ [Build 160828, API 160828]
SATSAT Tethys: Terms 101
000000.000: Module Dione.dll ............. [Build 160828, API 160828]
SATSAT Dione: Terms 59
000000.000: Module Rhea.dll .............. [Build 160828, API 160828]
SATSAT Rhea: Terms 68
000000.000: Module Titan.dll ............. [Build 160828, API 160828]
SATSAT Titan: Terms 100
000000.000: Module Iapetus.dll ........... [Build 160828, API 160828]
SATSAT Iapetus: Terms 605
000000.000: Module Uranus.dll ............ [Build 160828, API 160828]
VSOP87(B) Uranus: Precision 1e-006, Terms 1827/5269
000000.000: Module Miranda.dll ........... [Build ******, API 060425]
000000.000: Module Ariel.dll ............. [Build ******, API 060425]
000000.000: Module Umbriel.dll ........... [Build ******, API 060425]
000000.000: Module Titania.dll ........... [Build ******, API 060425]
000000.000: Module Oberon.dll ............ [Build ******, API 060425]
000000.000: Module Neptune.dll ........... [Build 160828, API 160828]
VSOP87(B) Neptune: Precision 1e-006, Terms 391/2024
000000.000: Finished initialising world
000000.000: Module Multistage2015.dll .... [Build 160930, API 160828]
000000.000: Multistage Version: 160929
000000.000: Load State Started
000000.000: SLS: Guidance File present: Config\Multistage2015\Guidance\SLS_BlockIb_LF_GNC.txt
000000.000: SLS: Orbit Call Found! Targets: Apogee:200000.0 Perigee:200000.0 Inclination:-29.7 Mode:1.0 GT initial Pitch: 78.0 Abside:200000.0
000000.000: SLS: Config File: C:\Orbiter2016\Config\Multistage2015\SLS_BLOCKIBCARGO_day.ini
000000.000: SLS: Number of stages in the ini file: 0
000000.000: SLS: Number of boosters group in the ini file: 0
000000.000: SLS: Number of Payloads in the ini file: 0
000000.000: SLS: Stage n. 1 Engines Exhaust Added--> number of engines: 1 , diameter: 0.000, position x: 0.000 y: 0.000 z: -0.000
000000.000: Load State Terminated
000000.000: Module SLSTOWER2.dll ......... [Build 161016, API 160828]
000000.000: Module LIGHTTOWER.dll ........ [Build 141213, API 100830]
000000.000: Module spotlight2.dll ........ [Build 110421, API 100830]
000000.000: Finished initialising status
000000.000: Finished initialising camera
000000.000: Finished setting up render state
000000.000: Post Creation Started
000000.000: SLS: Gravity Turn Initial Pitch by user: 78.000 Calculated:89.000
000000.000: Creating Launchpad
000000.000: Module EmptyModule.dll ....... [Build 160921, API 160828]
000000.000: Orbiter version: 160828 . Ramp is created through scenario file procedure
000000.000: RESET PEG
000000.000: SLS: Planet Reference Pressure = 101325.0 Pa  Atmosphere Altitude Limit:2500.0 km
000000.000: Post Creation Terminated
000000.000: Finished initialising panels
On the crawler. Something odd. The touchdown points don't change.

Code:
void SLSCRAWLER::clbkSetClassCaps(FILEHANDLE cfg) {
	// physical specs
	SetSize(6.08);
	SetEmptyMass(MASS);
	SetCW(0.9, 0.9, 2, 1.4);
	SetWingAspect(0.1);
	SetWingEffectiveness(0.1);
	SetCrossSections(_V(232.84, 1220.32, 166.36));
	SetRotDrag(_V(0.1, 0.1, 0.1));
	if (GetFlightModel() >= 1) {
		SetPitchMomentScale(1e-4);
		SetBankMomentScale(1e-4);
	}
	SetPMI(_V(163.54, 208.04, 76.03));
	SetTrimScale(0.05);
	SetCameraOffset(_V(16.0, 5.2, 17.5));
	//SetTouchdownPoints(tdvtx, ntdvtx);
	SetTouchdownPoints(_V(0, .001, 20), _V(-15, .001, -20), _V(15, .001, -20));;

	// visual specs
	iMeshMain = AddMesh("SLSCRAWLERNEW");
	SetMeshVisibilityMode(iMeshMain, MESHVIS_ALWAYS);


	PAD = CreateAttachment(false, _V(0, 6.27219, 0), _V(0, -1, 0), _V(0, 0, 1), "PAD", true);
	PAD_pos.x = 0;
	PAD_pos.y = 6.27219;
	PAD_pos.z = 0;
	PAD_INT_POS = 6.27219;
	PAD_proc = 0;
}

I change the Y value here and no change.

But here is the change touchdown code.

Code:
void SLSCRAWLER::UpdateTouchdownPoints() const
{
	double dCos = cos(lastHead);
	//unsigned short usAftIndex, usFwdIndex; // indicates which tracks are at 'aft' of crawler
	//sprintf(oapiDebugString(), "ydf %2.2f ", dCos);
	double fwd_rot_anim_pos = curFrontAngle / (20 * RAD);
	double back_rot_anim_pos = curBackAngle / (20 * RAD);
	if (dCos<0.0) {
		fwd_rot_anim_pos = -fwd_rot_anim_pos;
		back_rot_anim_pos = -back_rot_anim_pos;
	}


	double	newytouch = (jackHeight + curFrontHeight);
	sprintf(oapiDebugString(), "ydf %2.2f distdf %2.2f", newytouch, curFrontHeight);
	SetTouchdownPoints(_V(0, newytouch, 20.0), _V(-15, newytouch, -20.0), _V(15, newytouch, -20.0));;

I know it gets there as the values are displayed on the screen.

---------- Post added 11-23-16 at 05:09 AM ---------- Previous post was 11-22-16 at 07:29 PM ----------

Ok. I reloaded the .3 zip and got the missing eus. Then downloaded the new textures zip and all is there.
wpLsKEQ.jpg


But on the crawler. For some reason touchdown points do not effect the ship. The values show are what the Y value should be.
nsztul7.jpg



I made a thrust moving version and the touchdown points change so it looks like the VS2 moving might be the issue.

So how to i tell the crawler how far and relative position without the vs2 stuff? Or as it has been suggested to change the (rpos) of the vessel. Need help on both:)

---------- Post added at 05:53 PM ---------- Previous post was at 05:09 AM ----------

So if I just thrust to move The touchdown points move. So how do I tell if distance from pad is 330 then do something.
I have been told to use this
• OAPIFUNC void oapiGetRelativePos (OBJHANDLE hObj, OBJHANDLE hRef, VECTOR3∗pos) Returns the distance vector from hRef to hObj in the ecliptic reference frame.

Not sure what the code would look like.
The hRef would be the SLS_pad
hObj would be the crawler

I hope I get help:)

---------- Post added 11-24-16 at 07:29 AM ---------- Previous post was 11-23-16 at 05:53 PM ----------

SUCCESS!!!!!!!
Thanks to Fred18:salute:

The crawler can climb the hill in 2016. I am using thrust to move her.
RwV8zTf.jpg

As they say the devil is in the details. I need to get the animations to work.

---------- Post added at 06:09 PM ---------- Previous post was at 07:29 AM ----------

So this is weird.

In 2010 the y value of the touchdown down increase so it starts at .001 and goes to 13.5 at the top of the hill

BUT in 2016 the more negative the number the higher the vessel gets placed.

---------- Post added 11-25-16 at 07:55 AM ---------- Previous post was 11-24-16 at 06:09 PM ----------

I am at a loss. It seems when the crawler reaches a certain height it starts to nose down. And if you let it travel past the pad it levels out

CJHVOE9.jpg

test of y touchdown
gki0cYE.jpg

racWEBH.jpg

wQc8HvT.jpg

Touchdown and front and back height are the same. So it should be level
EqnyIxS.jpg
[/IMG]
here it leveled out.

Any ideas?
Code:
	CreateControlSurface(AIRCTRL_RUDDER, 5.0, 0.2, _V(0, 2, -15), AIRCTRL_AXIS_YPOS, anim_rudder);
	PROPELLANT_HANDLE TANK = CreatePropellantResource(FUELMASS);
	// ***************** thruster definitions *******************
	VECTOR3 dirfw = { 0, 0, -1 };
	VECTOR3 dirbk = { 0, 0, 1 };
	VECTOR3 dirlt = { 1, 0, 0 };
	VECTOR3 dirrt = { -1, 0, 0 };
	//main thrust
	th_main[0] = CreateThruster(_V(0, 0, 0), dirbk, MAXMAINTH, TANK, ISP);
	thg_main = CreateThrusterGroup(th_main, 1, THGROUP_MAIN);
	//retro thrust
	th_retro[0] = CreateThruster(_V(0, 0, 0), dirfw, MAXMAINTH, TANK, ISP);
	thg_retro = CreateThrusterGroup(th_retro, 1, THGROUP_RETRO);
	//yaw left thrust
	th_yaw_l[0] = CreateThruster(_V(0, 0, -10), dirlt, MAXRCSTH, TANK, RCSISP);
	th_yaw_l[1] = CreateThruster(_V(0, 0, 10), dirrt, MAXRCSTH, TANK, RCSISP);
	thg_yaw_l = CreateThrusterGroup(th_yaw_l, 2, THGROUP_ATT_YAWLEFT);
	//yaw right thrust
	th_yaw_r[0] = CreateThruster(_V(0, 0, 10), dirlt, MAXRCSTH, TANK, RCSISP);
	th_yaw_r[1] = CreateThruster(_V(0, 0, -10), dirrt, MAXRCSTH, TANK, RCSISP);
	thg_yaw_r = CreateThrusterGroup(th_yaw_r, 2, THGROUP_ATT_YAWRIGHT);

Code:
void SLSCRAWLER::checkTouchdownPoints() 
{
	double dCos = cos(lastHead);
	//sprintf(oapiDebugString(), "ENGINEdf %2.2f", distance);
	front_dist = distance - 20.0*abs(dCos);
	back_dist = distance + 20.0*abs(dCos);

//	SetAnimation(anim_front, 1);

	//sprintf(oapiDebugString(), "dist %2.2f  frtdist %2.2f backdist %2.2f heading %2.2f ", distance, front_dist, back_dist, dCos);
	//	sprintf(oapiDebugString(), "distdf %2.2f ", front_dist);
	// ramp to LC39 starts 390 m from pad and ends 131.5 m from pad
	if (front_dist < LC39_RAMP_START)
	{
		slope = ((LC39_RAMP_START - distance)*(15.45 / (LC39_RAMP_START - LC39_RAMP_END))); //
		if (slope >= 15.45) slope = 15.45;
		
		
		double front_dist2 = distance - (FWD_DRIVETRACK_Z_OFFSET - 5.723)*abs(dCos);
		double back_dist2 = distance - (REAR_DRIVETRACK_Z_OFFSET - 5.723)*abs(dCos);

		double front_height = ((LC39_RAMP_START - front_dist)*(15.45 / (LC39_RAMP_START - LC39_RAMP_END)));;
		double back_height = ((LC39_RAMP_START - back_dist)*(15.45 / (LC39_RAMP_START - LC39_RAMP_END)));;
	
		double front_height2 = ((LC39_RAMP_START - front_dist2)*(15.45 / (LC39_RAMP_START - LC39_RAMP_END)));;
		double back_height2 = ((LC39_RAMP_START - back_dist2)*(15.45 / (LC39_RAMP_START - LC39_RAMP_END)));;

		if (front_height >= 15.45) front_height = 15.45;
		if (back_height >= 15.45)back_height = 15.45;
		if (front_height2 >= 15.45) front_height2 = 15.45;
		if (back_height2 >= 15.45)back_height2 = 15.45;
		//	double front_height2 = CalcRampHeight(front_dist2);
	//	double back_height2 = CalcRampHeight(back_dist2);

		double fwdAngle = atan((front_height - front_height2) / (front_dist2 - front_dist));
		double backAngle = atan((back_height2 - back_height) / (back_dist - back_dist2));
		double fwd_rot_anim_pos = fwdAngle / (20 * RAD);
		double back_rot_anim_pos = backAngle / (20 * RAD);
		//sprintf(oapiDebugString(), "dist %2.2f  frtdist %2.2fbackdist %2.2f ", distance, front_height, back_height);

		if (dCos<0.0) {
			fwd_rot_anim_pos = -fwd_rot_anim_pos;
			back_rot_anim_pos = -back_rot_anim_pos;
		}
		// needed to prevent treads from appearing to sink into lover segment of ramp
		//front_height += range(0.0, (front_dist-131.5)*(0.4/(395.0-131.5)), 0.5);
		//back_height += range(0.0, (back_dist-131.5)*(0.4/(395.0-131.5)), 0.5);

		curFrontHeight = front_height;
		curBackHeight = back_height2;
		curFrontAngle = fwdAngle;
		curBackAngle = backAngle;

		UpdateTouchdownPoints();
		
	}
	else {
		curFrontHeight = curBackHeight = 0.01;
		curFrontAngle = curBackAngle = 0.0;
		UpdateTouchdownPoints();
	}
	
}
void SLSCRAWLER::UpdateTouchdownPoints() const
{
	double dCos = cos(lastHead);
	//unsigned short usAftIndex, usFwdIndex; // indicates which tracks are at 'aft' of crawler
	//sprintf(oapiDebugString(), "ydf %2.2f ", dCos);
	double fwd_rot_anim_pos = curFrontAngle / (20 * RAD);
	double back_rot_anim_pos = curBackAngle / (20 * RAD);
	if (dCos<0.0) {
		fwd_rot_anim_pos = -fwd_rot_anim_pos;
		back_rot_anim_pos = -back_rot_anim_pos;
	}


	double	newytouch = ((jackHeight + curFrontHeight)*-1);

	if (newytouch <= -15.45) newytouch = -15.45;
	//sprintf(oapiDebugString(), "ydf %2.2f distdf %2.2f", curFrontHeight, curBackHeight);
		SetTouchdownPoints(_V(0, newytouch, 20.0), _V(-15, newytouch, -20.0), _V(15, newytouch, -20.0));;
	SetAnimation(anim_ramp1, 0.5 + fwd_rot_anim_pos);
	SetAnimation(anim_ramp2, 0.5 + back_rot_anim_pos);
	sprintf(oapiDebugString(), "newytouch %2.2f ft dist %2.2f curb dist %2.2f BACKcurb dist %2.2f FWD ROT %2.2f", newytouch, front_dist, curFrontHeight, curBackHeight);
//	sprintf(oapiDebugString(), "dist %2.2f  frtdist %2.2fbackdist %2.2f ", distance, front_height, back_height);

	//double truck_height = min((JACKING_MAX_HEIGHT, jackHeight + curFrontHeight - curBackHeight) / JACKING_MAX_HEIGHT);
	//double truck_height1 = min((JACKING_MAX_HEIGHT, jackHeight) / JACKING_MAX_HEIGHT);
	//
	//SetAnimation(anim_front, 1);
	
	if (dCos > 0){


		SetAnimation(anim_rear, min(JACKING_MAX_HEIGHT, jackHeight + curFrontHeight - curBackHeight) / JACKING_MAX_HEIGHT);
        SetAnimation(anim_rear1, min(JACKING_MAX_HEIGHT, jackHeight + curFrontHeight - curBackHeight) / JACKING_MAX_HEIGHT);
		SetAnimation(anim_front, min(JACKING_MAX_HEIGHT, jackHeight) / JACKING_MAX_HEIGHT);
		SetAnimation(anim_front1, min(JACKING_MAX_HEIGHT, jackHeight) / JACKING_MAX_HEIGHT);
	}

	if (dCos < 0){


		SetAnimation(anim_rear, min(JACKING_MAX_HEIGHT, jackHeight) / JACKING_MAX_HEIGHT);
		SetAnimation(anim_rear1, min(JACKING_MAX_HEIGHT, jackHeight) / JACKING_MAX_HEIGHT);
		SetAnimation(anim_front, min(JACKING_MAX_HEIGHT, jackHeight + curFrontHeight - curBackHeight) / JACKING_MAX_HEIGHT);
		SetAnimation(anim_front1, min(JACKING_MAX_HEIGHT, jackHeight + curFrontHeight - curBackHeight) / JACKING_MAX_HEIGHT);
	}

	

	//sprintf(oapiDebugString(), "Hdf %2.2f FRTHIdf %2.2f BACKHdf %2.2f", jackHeight, curFrontHeight, curBackHeight);

}

Not sure if I need rcs to maintain level?

---------- Post added at 08:07 AM ---------- Previous post was at 07:55 AM ----------

Well I set the crawler at the height of the hill and she is nose down by 8 Degrees?

From the scenario?
cr:SLSCRAWLER
STATUS Orbiting Earth
RPOS -4886818.409 3885995.084 -1268083.256
RVEL 197.5432 141.5129 -327.5009
AROT 47.281 -31.724 -55.573
AFCMODE 7
PRPLEVEL 0:1.000000
NAVFREQ 0 0
END
 
Last edited:

Loopos

Procrastination Master
Joined
Sep 17, 2016
Messages
38
Reaction score
9
Points
8
Hey Longjap, I saw in your previous post that you were using Blender, can you teach me how to add the Orbiter mesh file to the Import Export files? Please put the codes for the python script ( if needed).
Oh yea btw, when will you release the update for SLS-Orion Block IB ( I only have the Block IB Cargo)
-Thanks!
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,757
Reaction score
2,740
Points
203
Location
Dallas, TX
Well I used shift mesh and adjusted camera and attachment points.
HS2B7gA.jpg


But detaching the tower gets a spinning tower.
:(
 

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Hey Longjap, I saw in your previous post that you were using Blender, can you teach me how to add the Orbiter mesh file to the Import Export files? Please put the codes for the python script ( if needed).
Oh yea btw, when will you release the update for SLS-Orion Block IB ( I only have the Block IB Cargo)
-Thanks!

Hi! I use the excellent import / export addon by vlad.
http://www.orbiter-forum.com/showthread.php?t=18661

All instructions are in the thread. Importing is very simple after installing. Just click "import orbiter mesh" IIRC and navigate to the mesh you want to import. Make sure to tick the box "include modifiers" in the export window if using them while exporting.

The Block Ib Orion is in the finishing stages. It relies for now on spacecraft4 which is not completely compatible. I'm still in doubt if I will include a Hab module to the stack or if I let the users choose their own payload to add. (Which always possible of course within Multistage) I think I can upload the IB Orion next week.

I've gotten pretty busy IRL now so I don't have the time I had to continue developing but progress is still steadily going forward. :)
 
Top