Idea Shuttle Fleet recompile for Orbiter 2016

Did you have the wrist angle at the 0 deg when you grappled it ?
 
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);
 
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);
 
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;
 
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
 
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.
 
Thanks.
So is there a way around the clipping?
fkLn8Px.jpg

orFsxEX.jpg


---------- 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:
DzvXjlp.jpg

Then in d3d9
TesGJ3m.jpg


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));

	}
 
Just an FYI. You don't have the EE lined up correctly for capture.
 
Oh. so more like this:
Pmxb3wO.jpg


I might add cross hairs.

Rv4Z47F.jpg


Not sure about the clipping though

So on the OBSS maybe when I attach I need to be rotated? To grab an item I have distance only should I have must have the correct angle also?
 
Oh. so more like this:


I might add cross hairs.



Not sure about the clipping though

So on the OBSS maybe when I attach I need to be rotated? To grab an item I have distance only should I have must have the correct angle also?
Yes, you need to have the EE rotated so that the pin of the alignment aid looks like a 2D white dot inside the center circle. If you can see the black shaft, you're not aligned. This screenshot shows a proper alignment: https://www.dropbox.com/s/wvrbqj9we10z3gc/EE_OBSS_aligned.jpg?dl=0
 
Lining up on the Dragon grapple fixture with the Canadarm2.

Using the EE camera and the boom camera.
 

Attachments

  • 10meters.jpg
    10meters.jpg
    104 KB · Views: 16
  • boomcam.jpg
    boomcam.jpg
    99.1 KB · Views: 16
Ok. Looking at the code of SSU and SSRMS for deteremining attachment status. On the Atlantis is was just a distance factor

---------- Post added at 05:20 PM ---------- Previous post was at 04:56 PM ----------

Code:
if (cameraView == ACTIVE_LEE) {
		// draw crosshairs
		// grapple target pin has diameter of 0.375 inches and is 4 inches long
		const double GRAPPLE_PIN_RADIUS = (0.5*0.375 / 12.0) / MPS2FPS;
		const double DIST_TO_PIN = (LEE_POS.z - LEE2_CAM_POS.z) - (4.0 / 12.0) / MPS2FPS; // distance from camera to grapple target pin
		int pinSize = round(hps->Scale*DEG*atan(GRAPPLE_PIN_RADIUS / DIST_TO_PIN)); // angular size of grapple target pin when EE is aligned with grapple fixture
		skp->Line(hps->CX - pinSize, hps->CY, hps->CX - pinSize - hps->Markersize, hps->CY);
		skp->Line(hps->CX + pinSize, hps->CY, hps->CX + pinSize + hps->Markersize, hps->CY);
		skp->Line(hps->CX, hps->CY - pinSize, hps->CX, hps->CY - pinSize - hps->Markersize);
		skp->Line(hps->CX, hps->CY + pinSize, hps->CX, hps->CY + pinSize + hps->Markersize);

But not sure what MP2FPS is declared

---------- Post added 09-16-18 at 08:20 AM ---------- Previous post was 09-15-18 at 05:20 PM ----------

So slowly adding rms code from SSU. But not sure where this is defined:
Code:
	SaveAnimation(pRMS_ep_anim);

There are several of the same command but with different animations

---------- Post added at 02:23 PM ---------- Previous post was at 08:20 AM ----------

So not sure which way to go. Looking at the SSU code I assume these are values from a panel

Code:
DiscInPort JointSelect[6], DirectDrivePlus, DirectDriveMinus;
	DiscInPort RHCInput[3], THCInput[3];
	DiscInPort RMSMode[12];
	DiscInPort RMSCoarseRateCMD;


I would use the SSRMS code since it is uses a window. But it has a Shoulder roll which except the MPM the rms doesn't have one.

---------- Post added at 03:39 PM ---------- Previous post was at 02:23 PM ----------

So I am trying to figure this external reference:
Code:
Error	59	error LNK2001: unresolved external symbol "union VECTOR3 __cdecl RotateVector(union VECTOR3 const &,double,union VECTOR3 const &)" (?RotateVector@@YA?ATVECTOR3@@ABT1@N0@Z)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj	SPACESHUTTLE2016RMS2

This is the code that sets it off:
Code:
void Atlantis::CalculateVectors()
{
	
	// work forward through joints and update vectors
	arm_ee_dir = _V(1, 0, 0);
	arm_ee_rot = RotateVectorX(_V(0, 0, 1), -joint_angle[SHOULDER_ROLL]); // should probably be -joint_angle[SR]
	//arm_ee_rot = _V(0, 0, 1);
	arm_ee_pos = _V(SR_SY_DIST, 0, 0) + arm_ee_rot*SY_SP_VERT_DIST;
	// handle SY joint; get new direction, than translate EE pos to compensate for horizontal offset between booms
	arm_ee_dir = RotateVector(arm_ee_rot, RAD*joint_angle[SHOULDER_YAW], arm_ee_dir);
	VECTOR3 rot_cross_dir = crossp(arm_ee_rot, arm_ee_dir); // pitch joints rotate around this vector
	arm_ee_pos -= rot_cross_dir*LEE_OFFSET;
	
	// handle 3 pitch joints
	arm_ee_dir = RotateVector(rot_cross_dir, RAD*joint_angle[SHOULDER_PITCH], arm_ee_dir);
	arm_ee_pos += arm_ee_dir*SP_EP_DIST;
	arm_ee_dir = RotateVector(rot_cross_dir, RAD*joint_angle[ELBOW_PITCH], arm_ee_dir);
	arm_ee_pos += arm_ee_dir*EP_WP_DIST;
	arm_ee_dir = RotateVector(rot_cross_dir, RAD*joint_angle[WRIST_PITCH], arm_ee_dir);
	arm_ee_rot = RotateVector(rot_cross_dir, RAD*(joint_angle[SHOULDER_PITCH] + joint_angle[ELBOW_PITCH] + joint_angle[WRIST_PITCH]), arm_ee_rot);
	arm_ee_pos -= arm_ee_rot*WP_WY_DIST;
	
	// wrist yaw
	arm_ee_dir = RotateVector(arm_ee_rot, RAD*joint_angle[WRIST_YAW], arm_ee_dir);
	arm_ee_pos += arm_ee_dir*WY_EE_DIST;
	// wrist roll
	arm_ee_rot = RotateVector(arm_ee_dir, RAD*joint_angle[WRIST_ROLL], arm_ee_rot);

	VECTOR3 old_arm_ee_pos = arm_tip[0] - SR_JOINT;
	old_arm_ee_pos = _V(old_arm_ee_pos.z, old_arm_ee_pos.x, -old_arm_ee_pos.y);
	
}

I believe it is in UltraMath.
And I have it included:
Code:
#define STRICT 1
#define ORBITER_MODULE
#include "Atlantis.h"
#include "PlBayOp.h"
//#include "AscentAP.h"
#include "DlgCtrl.h"
#include "meshres.h"
#include "meshresods.h"
#include "RMS2meshres.h"
#include "meshres_vc_hi.h"
#include "resource.h"
#include <stdio.h>
#include <fstream>
#include <UltraMath.h>


---------- Post added at 03:56 PM ---------- Previous post was at 03:39 PM ----------

More not sure it is seeing them:
Code:
Error	63	error LNK2001: unresolved external symbol "public: void __thiscall Atlantis::RotateVector(union VECTOR3 const &,union VECTOR3 const &,union VECTOR3 &)" (?RotateVector@Atlantis@@QAEXABTVECTOR3@@0AAT2@@Z)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj	SPACESHUTTLE2016RMS2
Error	59	error LNK2001: unresolved external symbol "public: void __thiscall Atlantis::GetRotMatrixZ(double,union MATRIX3 &)" (?GetRotMatrixZ@Atlantis@@QAEXNAATMATRIX3@@@Z)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj	SPACESHUTTLE2016RMS2
Error	60	error LNK2001: unresolved external symbol "public: void __thiscall Atlantis::GetRotMatrixY(double,union MATRIX3 &)" (?GetRotMatrixY@Atlantis@@QAEXNAATMATRIX3@@@Z)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj	SPACESHUTTLE2016RMS2
Error	61	error LNK2001: unresolved external symbol "public: void __thiscall Atlantis::GetRotMatrixX(double,union MATRIX3 &)" (?GetRotMatrixX@Atlantis@@QAEXNAATMATRIX3@@@Z)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj	SPACESHUTTLE2016RMS2
Error	62	error LNK2001: unresolved external symbol "public: union VECTOR3 __thiscall Atlantis::RotateVector(union VECTOR3 const &,double,union VECTOR3 const &)" (?RotateVector@Atlantis@@QAE?ATVECTOR3@@ABT2@N0@Z)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj	SPACESHUTTLE2016RMS2


---------- Post added at 07:24 PM ---------- Previous post was at 03:56 PM ----------

So I figure my links are off somewhere. I redid them to this. But now get this:
Error 3 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in Atlantis.obj C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\libUltra.lib(UltraMath.obj) SPACESHUTTLE2016RMS2
Error 4 error LNK1319: 1 mismatches detected C:\Orbiter2016\Orbitersdk\Modules\SPACESHUTTLE2016RMS2.dll 1 1 SPACESHUTTLE2016RMS2

Code:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="Atlantis.cpp" />
    <ClCompile Include="Common.cpp" />
    <ClCompile Include="PlBayOp.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\..\include\UltraMath.h" />
    <ClInclude Include="..\Common\Dialog\Graph.h" />
    <ClInclude Include="..\Common\Dialog\TabDlg.h" />
    <ClInclude Include="Atlantis.h" />
    <ClInclude Include="Graph.h" />
    <ClInclude Include="meshres.h" />
    <ClInclude Include="meshresods.h" />
    <ClInclude Include="meshres_vc_hi.h" />
    <ClInclude Include="PlBayOp.h" />
    <ClInclude Include="resource.h" />
    <ClInclude Include="RMS2meshres.h" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Atlantis.rc" />
  </ItemGroup>
  <ItemGroup>
    <Library Include="DlgCtrl.lib" />
  </ItemGroup>
  <ItemGroup>
    <Image Include="..\Bitmaps\tkbk_label.bmp" />
    <Image Include="down.ico" />
    <Image Include="ico00001.ico" />
    <Image Include="ico00002.ico" />
    <Image Include="ico00003.ico" />
    <Image Include="ico00004.ico" />
    <Image Include="icon1.ico" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectName>SPACESHUTTLE2016RMS2</ProjectName>
    <ProjectGuid>{1A57C099-C6AF-43A7-8899-83608A6FF011}</ProjectGuid>
    <RootNamespace>SPACESHUTTLERMS</RootNamespace>
    <Keyword>Win32Proj</Keyword>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>v120</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>v120</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <OutDir>..\..\..\Modules\</OutDir>
    <IntDir>$(Configuration)\</IntDir>
    <LinkIncremental>true</LinkIncremental>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <OutDir>..\..\..\Modules\SPACESHUTTLE2016RMS2.dll</OutDir>
    <IntDir>..\</IntDir>
    <LinkIncremental>false</LinkIncremental>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <AdditionalIncludeDirectories>C:\ORBITER2016\Orbitersdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;E3VIP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <MinimalRebuild>true</MinimalRebuild>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
      <PrecompiledHeader />
      <WarningLevel>Level3</WarningLevel>
      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
    </ClCompile>
    <Link>
      <AdditionalDependencies>orbiter.lib;orbitersdk.lib;libUltra.lib;gdi32.lib;user32.lib</AdditionalDependencies>
      <OutputFile>..\..\Modules\Spaceshuttlerms2.dll</OutputFile>
      <AdditionalLibraryDirectories>..\lib;..\libUltra\lib</AdditionalLibraryDirectories>
      <IgnoreSpecificDefaultLibraries>libcmt;libcmtd</IgnoreSpecificDefaultLibraries>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <AdditionalIncludeDirectories>c:\orbiter2016\Orbitersdk\include;C:\Orbiter2016\Orbitersdk\include\libUltra;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;E3VIP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader />
      <WarningLevel>Level3</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
    </ClCompile>
    <Link>
      <AdditionalDependencies>orbiter.lib;orbitersdk.lib;libUltra.lib;gdi32.lib;user32.lib</AdditionalDependencies>
      <OutputFile>..\..\Modules\SPACESHUTTLE2016RMS2.dll</OutputFile>
      <AdditionalLibraryDirectories>C:\Orbiter2016\Orbitersdk\lib;..\lib;..\libUltra\lib</AdditionalLibraryDirectories>
      <IgnoreSpecificDefaultLibraries>libcmt;libcmtd</IgnoreSpecificDefaultLibraries>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
    </Link>
  </ItemDefinitionGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>
I am using VS2013 professional It seem I maybe need an older UltraMAth or compile in a newer version?

---------- Post added at 08:14 PM ---------- Previous post was at 07:24 PM ----------

So I tried it in VS2017 Communtity and now get this:
Severity Code Description Project File Line Suppression State
Error LNK2038 mismatch detected for '_MSC_VER': value '1600' doesn't match value '1900' in Atlantis.obj SPACESHUTTLE2016RMS2 C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\libUltra.lib(UltraMath.obj) 1

---------- Post added 09-17-18 at 06:01 AM ---------- Previous post was 09-16-18 at 08:14 PM ----------

sO IN VS2017 i GET THIS:
Severity Code Description Project File Line Suppression State
Error LNK2038 mismatch detected for '_MSC_VER': value '1600' doesn't match value '1900' in Atlantis.obj SPACESHUTTLE2016RMS2 C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\libUltra.lib(UltraMath.obj) 1
IN VS2013 the same but value 1800.

---------- Post added at 07:28 PM ---------- Previous post was at 06:01 AM ----------

So I built libUltra in 2013:
Code:
1>------ Build started: Project: libUltra, Configuration: Release Win32 ------
1>  ValveManager.cpp
1>  libUltra_2013.vcxproj -> C:\Orbiter2016\Orbitersdk\samples\libUltra\./lib\libUltra.lib
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Then I tried to rebuild my solution in 2013:
Error 4 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in Atlantis.obj C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\libUltra.lib(UltraMath.obj) SPACESHUTTLE2016RMS2
Error 5 error LNK1319: 1 mismatches detected C:\Orbiter2016\Orbitersdk\Modules\SPACESHUTTLE2016RMS2.dll 1 1 SPACESHUTTLE2016RMS2
 
Last edited:
I wish I could help you. I hope you solve it.
 
So I am confused. I moved the SSU: libUltra files from the SSu folder into my Orbiter2016. Now I moved them into this folder:
C:\Orbiter2016\Orbitersdk\samples\libUltra\ and it built just fine in VS2013

But If I but the same files here:
C:\Orbiter2016\Orbitersdk\include and run the solution I get all sorts of errors but no missing links.

But this doesn't solve the using the wrong version error. Both used the same sdk set

moved the libUltra file here:C:\Orbiter2016\Orbitersdk and compiles fine
But doesn't solve wrong issue:

---------- Post added 09-19-18 at 05:51 AM ---------- Previous post was 09-18-18 at 01:06 PM ----------

At a lost not sure what I should do.

So I tried to compile in VS2017 and get the can't find the afxres.h

Severity Code Description Project File Line Suppression State
Error RC1015 cannot open include file 'afxres.h'. SPACESHUTTLE2016RMS2 C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.rc 10



back in 2013 I get a new error:
Error 9 error LNK2005: "double __cdecl linterp(double,double,double,double,double)" (?linterp@@YANNNNNN@Z) already defined in libUltra.lib(UltraMath.obj) C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\* CIL library *(* CIL module *) SPACESHUTTLE2016RMS2
Error 10 error LNK1169: one or more multiply defined symbols found C:\Orbiter2016\Orbitersdk\Modules\SPACESHUTTLE2016RMS2.dll 1 1 SPACESHUTTLE2016RMS2
 
Last edited:
I re-compiled the default Shuttle a long time ago using Visual Studio Express, and got the same error about missing afxres.h:

Even without knowing what I am doing, I replaced "afxres.h" with "winres.h"...and all was fine.
Found an article here:

http://www.winprog.org/tutorial/errors.html

From the article:



Fatal error RC1015: cannot open include file 'afxres.h'.
Oddly enough, VC++ adds afxres.h to resource files even when you aren't using an MFC project, and yet the file may only be installed if you install MFC. This perticular file isn't actually required, so to fix the error you can edit the .rc file in notepad and replace both occurances of "afxres.h" with "winres.h" (note that there should be two of them, and you need to change both).
 
SO I built libUltra and my solution using the same sdk in 2017 Community

But get these now:
Severity Code Description Project File Line Suppression State
Error LNK2038 mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in Atlantis.obj SPACESHUTTLE2016RMS2 C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\libUltra.lib(UltraMath.obj) 1
Error LNK2001 unresolved external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map@std@@YAPBDH@Z) SPACESHUTTLE2016RMS2 C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\libUltra.lib(UltraMath.obj) 1
Error LNK1120 1 unresolved externals SPACESHUTTLE2016RMS2 C:\Orbiter2016\Orbitersdk\Modules\SPACESHUTTLE2016RMS2.dll 1

---------- Post added at 03:51 PM ---------- Previous post was at 03:36 PM ----------

So I my solution set at MT libUltra is set at MD.

Code:
Error	61	error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Atlantis.obj	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\libUltra.lib(UltraMath.obj)	SPACESHUTTLE2016RMS2
So if I set mine to MD then I get this error:
Code:
Error	66	error LNK2005: "double __cdecl linterp(double,double,double,double,double)" (?linterp@@YANNNNNN@Z) already defined in libUltra.lib(UltraMath.obj)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\* CIL library *(* CIL module *)	SPACESHUTTLE2016RMS2
Error	67	error LNK1169: one or more multiply defined symbols found	C:\Orbiter2016\Orbitersdk\Modules\SPACESHUTTLE2016RMS2.dll	SPACESHUTTLE2016RMS2
I also took out the LibUltra.lib in the include. So now it is just Orbitsdk/include

---------- Post added at 04:44 PM ---------- Previous post was at 03:51 PM ----------

So I am back to this externals. They are in the Ultramath which is included.

I put them in my Atlantis.h and not change.

This is the code that has them:
Code:
if (!Eq(THCInput, _V(0.0, 0.0, 0.0), 0.0001) || !Eq(RHCInput, _V(0.0, 0.0, 0.0))) {
			VECTOR3 EETrans, newDir, newRot;
			if (RefFrame == BASE_FRAME) {
				EETrans = THCInput;
				RotateVector(arm_ee_dir, _V(RHCInput.data[ROLL], RHCInput.data[PITCH], RHCInput.data[YAW]), newDir);
				RotateVector(arm_ee_rot, _V(RHCInput.data[ROLL], RHCInput.data[PITCH], RHCInput.data[YAW]), newRot);
			}
			else if (RefFrame == EE_FRAME) {
				//EETrans = _V(THCInput.x*arm_ee_dir.x, THCInput.y*arm_ee_dir.y, THCInput.z*arm_ee_dir.z);
				EETrans = arm_ee_dir*THCInput.x + arm_ee_rot*THCInput.z + crossp(arm_ee_rot, arm_ee_dir)*THCInput.y;
			}
		}
				/*
				VECTOR3 y_axis = crossp(arm_ee_rot, arm_ee_dir);
				MATRIX3 RotMatrix = _M(arm_ee_dir.x, y_axis.x, arm_ee_rot.x,
					arm_ee_dir.y, y_axis.y, arm_ee_rot.y,
					arm_ee_dir.z, y_axis.z, arm_ee_rot.z);
				//MATRIX3 RotMatrix = RotationMatrix(arm_ee_dir, , arm_ee_rot);
				MATRIX3 RotMatrixRoll, RotMatrixPitch, RotMatrixYaw;
				GetRotMatrixX(RHCInput.data[ROLL], RotMatrixRoll);
				GetRotMatrixY(RHCInput.data[PITCH], RotMatrixPitch);
				GetRotMatrixZ(RHCInput.data[YAW], RotMatrixYaw);
				RotMatrix = mul(RotMatrix, RotMatrixPitch);
				RotMatrix = mul(RotMatrix, RotMatrixYaw);
				RotMatrix = mul(RotMatrix, RotMatrixRoll);

				newDir = _V(RotMatrix.m11, RotMatrix.m21, RotMatrix.m31);
				newRot = _V(RotMatrix.m13, RotMatrix.m23, RotMatrix.m33);
			}
			MoveEE(arm_ee_pos + EETrans, newDir, newRot, simdt);
		}
		//if(!Eq(THCInput, _V(0.0, 0.0, 0.0), 0.01)) MoveEE(arm_ee_pos+RotateVectorZ(EETrans, joint_angle[SHOULDER_ROLL]), arm_ee_dir, arm_ee_rot);
 
Error LNK2038 mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in Atlantis.obj SPACESHUTTLE2016RMS2 C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016 RMSSS\libUltra.lib(UltraMath.obj) 1

Ok...I am not at expert, but did you (Unix-Speaking) a kind of "make clean" before tried to recompile ?
Or in other words (I really don't remember the "Windows-VS-Studio-function/button for a "make clean") to make sure, that you are not using obsoleted OBJ-files in your latest build ? ( value '1800' doesn't match value '1900' in Atlantis.obj )
 
Yes. I did. I ran the libultra and shuttle solution on the same sdk and compiler. But sure where to check the version. Also the mt or md issue

---------- Post added 09-20-18 at 05:53 AM ---------- Previous post was 09-19-18 at 08:30 PM ----------

So on the external issue.
it is called here and defined in Ultramath.h
See the highlighted area shows the definition.
0SqVyO1.jpg


Code:
Error    60    error LNK2001: unresolved external symbol "void __cdecl RotateVector(union VECTOR3 const &,union VECTOR3 const &,union VECTOR3 &)" (?RotateVector@@YAXABTVECTOR3@@0AAT1@@Z)    C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj    1    1    SPACESHUTTLE2016RMS2
This is the code that is setting the errors:
Code:
RotateVector(arm_ee_dir, _V(RHCInput.data[ROLL], RHCInput.data[PITCH], RHCInput.data[YAW]), newDir);
                RotateVector(arm_ee_rot, _V(RHCInput.data[ROLL], RHCInput.data[PITCH], RHCInput.data[YAW]), newRot);
And in Ultramath:
Code:
VECTOR3 RotateVector(const VECTOR3 &Axis, double radAngle, const VECTOR3 &v);
/**
 * Rotates vector around specified Euler angles in XYZ order
 */
void RotateVector(const VECTOR3 &Initial, const VECTOR3 &Angles, VECTOR3 &Result);
/**
 * Returns Euler angles (in radians); Pitch=X axis, Yaw=Y axis, Roll=Z axis
  */




So if I comment those definitions out of Ultramath.h I get the same results.


So to me it means it may not be seeing Ultramath.h


I tried putting them in my Atlantis.H and the same result. So not sure how to fix:(

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

So this line:
Code:
RotateVector(arm_ee_dir, _V(RHCInput.data[ROLL], RHCInput.data[PITCH], RHCInput.data[YAW]), newDir);

Give me this error:
Code:
Error	60	error LNK2001: unresolved external symbol "public: void __thiscall Atlantis::RotateVector(union VECTOR3 const &,union VECTOR3 const &,union VECTOR3 &)" (?RotateVector@Atlantis@@QAEXABTVECTOR3@@0AAT2@@Z)	C:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016RMSSS\Atlantis.obj	1	1	SPACESHUTTLE2016RMS2

So in my H:
Code:
VECTOR3 RotateVector(const VECTOR3 &Axis, double radAngle, const VECTOR3 &v);
	/**
	* Rotates vector around specified Euler angles in XYZ order
	*/
	void RotateVector(const VECTOR3 &Initial, const VECTOR3 &Angles, VECTOR3 &Result);

What am I missing?
 
Last edited:
Back
Top