Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Requests
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Requests If you have a request for a new addon or want to know where to find a specific addon, ask it here!

Reply
 
Thread Tools
Old 09-11-2018, 11:32 AM   #136
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So on the OBSS

From the sf doc he had the attachment for obss at:
PL1_OFS 2.850 2.150 3.850
PL1_DIR 0.000 1.000 0.000
PL1_ROT 1.000 0.000 0.000

But I can see I need to adjust the point to fit it better into the MPM. But When I move the point the OBSS goes away and ctd. I see why because the rotation vectors are the same. Any ideas.
gattispilot is offline   Reply With Quote
Old 09-11-2018, 04:07 PM   #137
Donamy
Beta Tester


Default

I think you are trying to move both attachment points, when you only need to move one.
Donamy is offline   Reply With Quote
Old 09-11-2018, 11:29 PM   #138
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Donamy View Post
 I think you are trying to move both attachment points, when you only need to move one.
I only move the one in the shuttle

The SSU looks like it uses this:
Code:
OBSS_ATTACHMENT_POINT+MPM_MESH_OFFSET, _V(0,1,0), _V(0,0,1), "OBSS");
But makes the OBSS 90 degrees out of synch for me.
Code:
armobss_tip[0] = OBSS_POS;
	armobss_tip[1] = OBSS_POS + _V(0.0, 1.0, 0.0);
	armobss_tip[2] = OBSS_POS + _V(1.0, 0.0, 0.0);
Code:
	SetAttachmentParams(OBSS_attach, armobss_tip[0], armobss_tip[1] - armobss_tip[0], armobss_tip[2] - armobss_tip[0]);
Code:
//mpmobss
	static UINT OBSSmpm[1] = { 0 };
	static MGROUP_ROTATE OBSS_A(7, OBSSmpm, 1,_V(2.544, 1.187, 9.613), _V(0, 0, 1), (float)(-30 * RAD)); // -180 .. +180
	anim_MPMOBSS = CreateAnimation(0.0);
	obssparent = AddAnimationComponent(anim_MPMOBSS, 0, 1, &OBSS_A);
	obss_anim[0] = new MGROUP_ROTATE(LOCALVERTEXLIST, MAKEGROUPARRAY(armobss_tip), 3, OBSS_POS, _V(0, 0, 1), (float)(0.0));
	AddAnimationComponent(anim_MPMOBSS, 0, 1, obss_anim[0], obssparent);


---------- Post added at 06:29 PM ---------- Previous post was at 11:58 AM ----------

Not sure what is going on here.
This is the OBSS_SSu attached and it looks good:
and here is the UltraOBSS
not sure why the rot is 0,0,0?
UltraOBSS:
Code:
[CHILD_ATTACH_0] ; To MPM's
POS = (-0.13,0.32,2.210)
DIR = (0,-1,0)
ROT = (1,0,0)
ID = "OS"
and SSU _OBSS
Code:
P -0.05 -0.275 1.47 0 -1 0 0 0 1 OS ; To MPM's

Last edited by gattispilot; 09-11-2018 at 06:18 PM.
gattispilot is offline   Reply With Quote
Old 09-12-2018, 12:35 AM   #139
Donamy
Beta Tester


Default

Someone rotated it, of course.
Donamy is offline   Reply With Quote
Thanked by:
Old 09-12-2018, 10:30 AM   #140
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Donamy View Post
 Someone rotated it, of course.
Well this works for me:
I made a new cfg and used the SSU attachment vector

P -0.13 0.32 2.210 0 -1 0 0 0 1 OS ; To MPM's




But the odd thing is this Here I just grapped it and lifted it up

ATTACHED 1:1,STS-126
exited and reloaded and now it is this:

here it is
ATTACHED 1:1,STS-126
gattispilot is offline   Reply With Quote
Old 09-12-2018, 04:32 PM   #141
Donamy
Beta Tester


Default

Did you have the wrist angle at the 0 deg when you grappled it ?
Donamy is offline   Reply With Quote
Old 09-12-2018, 09:55 PM   #142
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Of the rms? Not sure but the RMS did not change.

---------- Post added at 04:55 PM ---------- Previous post was at 01:06 PM ----------

This is what the arm setting were at;
ARM_STATUS 0.7510 0.7766 0.8281 0.2857 0.5000 0.5000

Code:
	sprintf (cbuf, "%0.4f %0.4f %0.4f %0.4f %0.4f %0.4f", arm_sy, arm_sp, arm_ep, arm_wp, arm_wy, arm_wr);
	oapiWriteScenario_string (scn, "ARM_STATUS", cbuf);
gattispilot is offline   Reply With Quote
Old 09-14-2018, 12:27 PM   #143
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I figured out why my camera direction was off as it wasn't being calculated.

Code:
void RMSSystem::UpdateEECamView() const
{
	if(oapiCameraInternal()) {
		// calculate rotation angle for EE cam
		VECTOR3 dir = arm_tip[1]-arm_tip[0];
		// if camera is pointing straight up or down, make it slightly offset from (0,1,0) vector
		if(Eq(dotp(dir, _V(0, -1, 0)), 1.0, 1e-4)) dir = _V(1.74532924314e-4, -0.999999984769, 0.0);
		else if(Eq(dotp(dir, _V(0, 1, 0)), 1.0, 1e-4)) dir = _V(1.74532924314e-4, 0.999999984769, 0.0);
		VECTOR3 orbiter_cam_rot = crossp(crossp(dir, _V(0, 1, 0)), dir);
		orbiter_cam_rot /= length(orbiter_cam_rot);
		if(orbiter_cam_rot.y < 0) orbiter_cam_rot = -orbiter_cam_rot;
		double angle = SignedAngle(orbiter_cam_rot, arm_tip[2]-arm_tip[0], dir);

		//sprintf_s(oapiDebugString(), 255, "Rot Vec: %f %f %f dir: %f %f %f dot_prod: %f Angle: %f %f", orbiter_cam_rot.x, orbiter_cam_rot.y, orbiter_cam_rot.z, dir.x, dir.y, dir.z, dot_prod, angle, angle*DEG);
		//sprintf_s(oapiDebugString(), 255, "Rot Vec: %f %f %f cam dir: %f %f %f dir: %f %f %f Angle: %f %f length: %f", orbiter_cam_rot.x, orbiter_cam_rot.y, orbiter_cam_rot.z, arm_tip[2].x-arm_tip[0].x, arm_tip[2].y-arm_tip[0].y, arm_tip[2].z-arm_tip[0].z,  dir.x, dir.y, dir.z, angle, angle*DEG, length(dir));
		//sprintf_s(oapiDebugString(), 255, "dot_prod: %f Angle: %f %f", dot_prod, angle, angle*DEG);

		STS()->SetCameraOffset(STS()->GetOrbiterCoGOffset()+arm_tip[4]+RMS_MESH_OFFSET);
		//STS()->SetCameraDefaultDirection (arm_tip[1]-arm_tip[0], 0.0);
		STS()->SetCameraDefaultDirection (dir, angle);
		oapiCameraSetCockpitDir(0.0, 0.0);
	}
}
So looking at SSU and SSRMS code. What I don't get is this:
Code:
SetCameraDefaultDirection (dir, angle);
Because is SetCameraDefaultDirection (VECTOR);
gattispilot is offline   Reply With Quote
Old 09-14-2018, 12:52 PM   #144
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 What I don't get is this:
Code:
SetCameraDefaultDirection (dir, angle);
Because is SetCameraDefaultDirection (VECTOR);
No, it isn't. Its polymorph:

Code:
    /**
     * \brief Set the default camera direction and tilt angle for internal (cockpit) view.
     * \param cd new default direction in vessel coordinates
     * \param tilt camera tilt angle around the default direction [rad]
     * \note This function allows to set the camera tilt angle in addition to the default
     *   direction.
     * \note By default, the default direction is (0,0,1), i.e. forward, and the tilt
     *   angle is 0 (upright).
     * \note The supplied direction vector must be normalised to length 1.
     * \note The tilt angle should be in the range [-Pi,+Pi]
     * \note Calling this function automatically sets the current actual view direction to
     *   the default direction.
     * \sa SetCameraDefaultDirection(const VECTOR3&)const, GetCameraDefaultDirection
     */
void SetCameraDefaultDirection (const VECTOR3 &cd, double tilt) const;
Urwumpe is offline   Reply With Quote
Thanked by:
Old 09-14-2018, 01:39 PM   #145
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks. I will see if I can get it to work in mine

I guess I may need to include #include <UltraMath.h> My just has math
gattispilot is offline   Reply With Quote
Old 09-14-2018, 01:49 PM   #146
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 Thanks. I will see if I can get it to work in mine

I guess I may need to include #include <UltraMath.h> My just has math
If you are using SSU code, likely, yes.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 09-15-2018, 01:11 PM   #147
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks.
So is there a way around the clipping?



---------- Post added at 08:11 AM ---------- Previous post was at 07:50 AM ----------

So this is odd. Same dll in both cases. This is the view in regular graphics:

Then in d3d9


notice the values and the view doesn't change.

Code:
if (CAM == 6){//elbow view

		VECTOR3 dir = camRMSElbowLoc[1] - camRMSElbowLoc[0];
		if (Eq(dotp(dir, _V(0, -1, 0)), 1.0, 1e-4)) dir = _V(1.74532924314e-4, -0.999999984769, 0.0);
		else if (Eq(dotp(dir, _V(0, 1, 0)), 1.0, 1e-4)) dir = _V(1.74532924314e-4, 0.999999984769, 0.0);
		VECTOR3 orbiter_cam_rot = crossp(crossp(dir, _V(0, 1, 0)), dir);
		orbiter_cam_rot /= length(orbiter_cam_rot);
		if (orbiter_cam_rot.y < 0) orbiter_cam_rot = -orbiter_cam_rot;
		double angle = SignedAngle(orbiter_cam_rot, camRMSElbowLoc[2] - camRMSElbowLoc[0], dir);
		SetCameraDefaultDirection(dir, angle);
		SetCameraOffset(camRMSElbowLoc[0]);
		oapiCameraSetCockpitDir(0.0, 0.0);
		sprintf_s(oapiDebugString(), 255, "Rot Vec: %f %f %f cam dir: %f %f %f dir: %f %f %f Angle: %f %f length: %f", orbiter_cam_rot.x, orbiter_cam_rot.y, orbiter_cam_rot.z, camRMSElbowLoc[1].x - camRMSElbowLoc[0].x, camRMSElbowLoc[2].y - camRMSElbowLoc[0].y, camRMSElbowLoc[2].z - camRMSElbowLoc[0].z, dir.x, dir.y, dir.z, angle, angle*DEG, length(dir));

	}
gattispilot is offline   Reply With Quote
Old 09-15-2018, 07:22 PM   #148
Donamy
Beta Tester


Default

Just an FYI. You don't have the EE lined up correctly for capture.
Donamy is offline   Reply With Quote
Old 09-15-2018, 07:48 PM   #149
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Donamy View Post
 Just an FYI. You don't have the EE lined up correctly for capture.
Thanks. But the camera view and attachment are different, right
gattispilot is offline   Reply With Quote
Old 09-15-2018, 08:28 PM   #150
DaveS
Addon Developer
 
DaveS's Avatar


Default

Quote:
Originally Posted by gattispilot View Post
 Thanks. But the camera view and attachment are different, right
Not really since the camera is hard mounted to the end effector. The end effector camera is what the crew uses to align the EE with the grapple fixture on the target. The grapple fixture has a black&white alignment aid mounted right above it which is used to ensure proper alignment for capture.


https://www.dropbox.com/s/4i2mkv4bdq...xture.jpg?dl=0
DaveS is online now   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Requests


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 09:22 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.