Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 09-06-2018, 12:39 PM   #1
gattispilot
Addon Developer
 
gattispilot's Avatar
Default compling ssrms

So I am trying to make a rms solution. Mainly so I can adapt it for the shuttle 2016. but for other projects.


So getting the h and rc and cpp from here:
http://svn.code.sf.net/p/shuttleultr...itersdk/SSRMS/


I added to a new solution and tried to build.


I am getting 8 external external. But I can't seem to find where they are defined in the LEESystem h and SSRMS.h


Then when I try to edit the rc i get this error:




Not sure if they are somewhere in the SSU code?

RotateVector
GetRotMatrixZ
GetRotMatrixY
GetRotMatrixX
GetYZX_PYRAnglesFromMatrix
linterp
CalculateCameraRotationAngle



Code:
Error	29	error LNK2001: unresolved external symbol "void __cdecl  RotateVector(union VECTOR3 const &,union VECTOR3 const &,union  VECTOR3 &)" (?RotateVector@@YAXABTVECTOR3@@0AAT1@@Z)	 C:\Orbiter2016\Orbitersdk\samples\newarm\SSRMS.obj	newarm
Error	31	error LNK2001: unresolved external symbol "void __cdecl  GetRotMatrixZ(double,union MATRIX3 &)"  (?GetRotMatrixZ@@YAXNAATMATRIX3@@@Z)	 C:\Orbiter2016\Orbitersdk\samples\newarm\SSRMS.obj	newarm
Error	26	error LNK2001: unresolved external symbol "void __cdecl  GetRotMatrixY(double,union MATRIX3 &)"  (?GetRotMatrixY@@YAXNAATMATRIX3@@@Z)	 C:\Orbiter2016\Orbitersdk\samples\newarm\SSRMS.obj	newarm
Error	24	error LNK2001: unresolved external symbol "void __cdecl  GetRotMatrixX(double,union MATRIX3 &)"  (?GetRotMatrixX@@YAXNAATMATRIX3@@@Z)	 C:\Orbiter2016\Orbitersdk\samples\newarm\SSRMS.obj	newarm
Error	28	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\newarm\SSRMS.obj	newarm
Error	25	error LNK2001: unresolved external symbol "union VECTOR3  __cdecl GetYZX_PYRAnglesFromMatrix(union MATRIX3 const &)"  (?GetYZX_PYRAnglesFromMatrix@@YA?ATVECTOR3@@ABTMAT  RIX3@@@Z)	 C:\Orbiter2016\Orbitersdk\samples\newarm\SSRMS.obj	newarm
Error	27	error LNK2001: unresolved external symbol "double __cdecl  linterp(double,double,double,double,double)" (?linterp@@YANNNNNN@Z)	 C:\Orbiter2016\Orbitersdk\samples\newarm\SSRMS.obj	newarm
Error	30	error LNK2001: unresolved external symbol "double __cdecl  CalculateCameraRotationAngle(union VECTOR3 &,union VECTOR3 const  &)" (?CalculateCameraRotationAngle@@YANAATVECTOR3@@ABT  1@@Z)	 C:\Orbiter2016\Orbitersdk\samples\newarm\SSRMS.obj	newarm
Error	32	error LNK1120: 8 unresolved externals	C:\Orbiter2016\Modules\newarm.dll	newarm


---------- Post added at 05:02 PM ---------- Previous post was at 07:15 AM ----------

Well I thought I found the issue. I needed UltraMath.h. I had it in my
C:\Orbiter2016\Orbitersdk\include folder.

But i added it to the solution but the same issue


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>
  <PropertyGroup Label="Globals">
    <ProjectName>newarm</ProjectName>
    <ProjectGuid>{1A57C099-C6AF-43A7-8899-83608A6FF011}</ProjectGuid>
    <RootNamespace>MSL_ROVER</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\</OutDir>
    <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;orbitersoundsdk35.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>C:\ORBITER2016\\Orbitersdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
      <IgnoreSpecificDefaultLibraries>msvcrt.lib libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <SubSystem>Windows</SubSystem>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <AdditionalIncludeDirectories>C:\ORBITER2016\Orbitersdk\include;%(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;%(AdditionalDependencies)</AdditionalDependencies>
      <OutputFile>./../../../Modules/newarm.dll</OutputFile>
      <AdditionalLibraryDirectories>C:\ORBITER2016\Orbitersdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <IgnoreSpecificDefaultLibraries>msvcrt;msvcprt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="LEESystem.CPP" />
    <ClCompile Include="SSRMS.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\..\include\UltraMath.h" />
    <ClInclude Include="LEESystem.H" />
    <ClInclude Include="resource.h" />
    <ClInclude Include="SSRMS.h" />
  </ItemGroup>
  <ItemGroup>
    <Library Include="DlgCtrl.lib" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="newarm.rc" />
  </ItemGroup>
  <ItemGroup>
    <Image Include="Bitmaps\warning.bmp" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>
Code:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "newarm", "newarm.vcxproj", "{1A57C099-C6AF-43A7-8899-83608A6FF011}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
		Release|Win32 = Release|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{1A57C099-C6AF-43A7-8899-83608A6FF011}.Debug|Win32.ActiveCfg = Debug|Win32
		{1A57C099-C6AF-43A7-8899-83608A6FF011}.Debug|Win32.Build.0 = Debug|Win32
		{1A57C099-C6AF-43A7-8899-83608A6FF011}.Release|Win32.ActiveCfg = Release|Win32
		{1A57C099-C6AF-43A7-8899-83608A6FF011}.Release|Win32.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


---------- Post added 09-06-18 at 05:25 AM ---------- Previous post was 09-05-18 at 05:02 PM ----------

Not sure if my setup is correct?


I do have UltraMath,... in the include folder

---------- Post added at 07:39 AM ---------- Previous post was at 05:25 AM ----------

So it seems I need to add libUltra to the solution. But not sure how to?


http://svn.code.sf.net/p/shuttleultr...rsdk/libUltra/

Last edited by gattispilot; 09-05-2018 at 10:23 PM.
gattispilot is offline   Reply With Quote
Old 09-09-2018, 11:08 AM   #2
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So from what DAve S said told me I need to get all the files and add them into a folder and then try to build based off the SSrms solution?
The same for LibUltra. , right?


Are these files in a zip somewhere. The libUltra has a lot of files.

---------- Post added at 03:29 PM ---------- Previous post was at 07:52 AM ----------

So I redid the solution.
MORE ERRORS
Error 11 error C1083: Cannot open include file: 'ValveManager.h': No such file or directory C:\Orbiter2016\Orbitersdk\samples\libUltra\src\Val veManager.cpp 1 1 libUltra
Error 16 error C1083: Cannot open include file: 'orbitersdk.h': No such file or directory c:\orbiter2016\orbitersdk\samples\ssrms\SSRMS.h 5 1 SSRMS
Error 10 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (src\UltraMath.cpp) C:\Orbiter2016\Orbitersdk\samples\libUltra\include \UltraMath.h 27 1 libUltra
Error 9 error C1083: Cannot open include file: 'orbiterapi.h': No such file or directory (src\StateVectorPropagator.cpp) c:\orbiter2016\orbitersdk\samples\libultra\include \StateVectorPropagator.h 5 1 libUltra
Error 7 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (src\PIDControl.cpp) C:\Orbiter2016\Orbitersdk\samples\libUltra\include \UltraMath.h 27 1 libUltra
Error 6 error C1083: Cannot open include file: 'Orbiterapi.h': No such file or directory (src\PEG4Targeting.cpp) C:\Orbiter2016\Orbitersdk\samples\libUltra\include \PEG4Targeting.h 4 1 libUltra
Error 5 error C1083: Cannot open include file: 'Orbiterapi.h': No such file or directory (src\LambertBurnTargeting.cpp) C:\Orbiter2016\Orbitersdk\samples\libUltra\include \LambertBurnTargeting.h 4 1 libUltra
Error 14 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (src\AerodynamicLookupTables.cpp) C:\Orbiter2016\Orbitersdk\samples\libUltra\include \UltraMath.h 27 1 libUltra
Error 3 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (KOST\kost_shape.cpp) c:\orbiter2016\orbitersdk\samples\libultra\kost\ko st_settings.h 53 1 libUltra
Error 4 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (KOST\kost_propagate.cpp) c:\orbiter2016\orbitersdk\samples\libultra\kost\ko st_settings.h 53 1 libUltra
Error 1 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (KOST\kost_linalg.cpp) c:\orbiter2016\orbitersdk\samples\libultra\kost\ko st_settings.h 53 1 libUltra
Error 2 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (KOST\kost_elements.cpp) c:\orbiter2016\orbitersdk\samples\libultra\kost\ko st_settings.h 53 1 libUltra
Error 8 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory C:\Orbiter2016\Orbitersdk\samples\libUltra\src\Shu ttleBus.cpp 5 1 libUltra
Error 12 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory C:\Orbiter2016\Orbitersdk\samples\libUltra\src\Dis creteBundleManager.cpp 2 1 libUltra
Error 13 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory C:\Orbiter2016\Orbitersdk\samples\libUltra\src\Dis creteBundle.cpp 7 1 libUltra
Error 15 error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory C:\Orbiter2016\Orbitersdk\samples\libUltra\include \Subsystem.h 34 1 SSRMS




---------- Post added 09-08-18 at 06:43 AM ---------- Previous post was 09-07-18 at 03:29 PM ----------

So OrbiterAPI.h is in the include library. Does it need to be somewhere else. Need help on this.

---------- Post added 09-09-18 at 06:08 AM ---------- Previous post was 09-08-18 at 06:43 AM ----------

So I tried getting the 2017 Windows 10 SSU. When I ran the 2013 Sln for SSMRS. I get this error:

1>c:\ssu\orbitersdk\libultra\include\ultramath.h(2 7): fatal error C1083: Cannot open include file: 'OrbiterAPI.h': No such file or directory (compiling source file src\PIDControl.cpp)

Several cannot find OrbiterAPI.h
gattispilot is offline   Reply With Quote
Old 09-13-2018, 12:18 PM   #3
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Well I at a lost. Not sure why the 2013 solution can not find the OrbiterAPI.h?

I tried making the SSU for 2017 and had a issue also not no luck on it.

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Mic rosoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.15063.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
1>Done building project "libUltra_2017.vcxproj" -- FAILED.

I installed this but the same issue:
https://developer.microsoft.com/en-u...windows-10-sdk

So again at a lost. I might try just getting the things from the Ultralib I need to get it to work.

My goal is to get the translation part to work for the rms on the 2016 shuttle
gattispilot is offline   Reply With Quote
Thanked by:
Old 09-23-2018, 09:55 AM   #4
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I got it to compile.


But when I add it into a scn I get a CTD.
The only mention in the log is:
Code:
===============================================================
000047.646: Added subsystem LEE1.
000047.646: Added subsystem LEE2.
gattispilot is offline   Reply With Quote
Old 09-23-2018, 05:44 PM   #5
Donamy
Beta Tester


Default

What does the scenario say ?
Donamy is offline   Reply With Quote
Old 09-23-2018, 07:11 PM   #6
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I was able to get it to work.

The one thing I needed to change was in the rc file is this :
#include <commctrl.h>

Once I removed that line and took the bitmap away it worked.
gattispilot is offline   Reply With Quote
Old 09-23-2018, 09:25 PM   #7
Donamy
Beta Tester


Default

Sweet !!
Donamy is offline   Reply With Quote
Thanked by:
Old 10-03-2018, 12:21 PM   #8
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I am trying to get this to work with a arm that doesn't have 1 set of angles and softstops

The ssmrs has angles of the joints -270 to +270

Mine doesn't:
Code:
const double JOINT_LIMITS[3][7] = { { -180.0, +180.0, -85.0, +130.0, -180.0, +180.0 }, { -155.0, +155.0, -215.0, +90, -95.0, +130 },{ -180.0, +180.0 } };

const double JOINT_SOFTSTOPS[3][7] = { { -177.0, +177.0, -82.0, +126.0, -177.0, +177.0 },
{ -151.4, +151.4, -210.0, +85.0, -90.0, +125.0 }, { -177.0, +177.0 } };
So this the ssrms
Code:
bool SSRMS::SetJointAngle(SSRMS::SSRMS_JOINT joint, double angle)
{
	if(angle>=JOINT_SOFTSTOPS[0] && angle<=JOINT_SOFTSTOPS[1]) {
		double pos=linterp(JOINT_LIMITS[0], 0.0, JOINT_LIMITS[1], 1.0, angle);
		if(activeLEE == 0 && (joint == SHOULDER_YAW || joint == WRIST_YAW)) pos = 1.0-pos; // yaw joints rotate in different directions depending on which LEE is active
		SetAnimation(anim_joint[activeLEE][joint], pos);
		joint_angle[joint]=angle;
		arm_moved=true;
		update_camera = true;
		return true;
	}
	else return false;
}
So now I did this.
Code:
bool SSRMS::SetJointAngle(SSRMS::SSRMS_JOINT joint, double angle)
{
	if (angle >= JOINT_SOFTSTOPS[0][joint] && angle <= JOINT_SOFTSTOPS[1][joint]) {
		double pos = linterp(JOINT_LIMITS[0][joint], 0.0, JOINT_LIMITS [1][joint], 1.0, angle);
		//double pos=linterp(RMS_JOINT_LIMITS[0][joint], 0.0, RMS_JOINT_LIMITS[1][joint], 1.0, angle); ssu
		if (activeLEE == 0 && (joint == SHOULDER_YAW || joint == WRIST_YAW)) pos = 1.0 - pos; // yaw joints rotate in different directions depending on which LEE is active
		SetAnimation(anim_joint[joint], pos);
		joint_angle[joint] = angle;
		arm_moved = true;
		update_camera = true;
		return true;
	}
	else return false;
}
basically added [joint] to to joint stops.
Code:
DEXTRE5:DEXTRE5
  STATUS Orbiting Earth
  RPOS -1416611.172 -5809070.737 3210632.517
  RVEL -6470.8410 3083.5772 2711.4367
  AROT -6.462 9.796 -46.564
  VROT 0.0385 -0.0254 0.0866
  AFCMODE 7
  PRPLEVEL 0:1.000000
  NAVFREQ 0 0
  ARM_STATUS -1.305480 -55.297499 -138.487089 157.244084 -94.215102 43.662889 -42.335801
  ACTIVE_LEE 1
  FOLDED 1 1.0000
  ACTIVE_CAMERA 0
  CAM_STATUS 0.000000 0.000000 0.000000 0.000000
@SUBSYSTEM LEE1
@ENDSUBSYSTEM		;LEE1
@SUBSYSTEM LEE2
@ENDSUBSYSTEM		;LEE2
END
END_SHIPS
So now I get no arm movement

---------- Post added at 07:57 PM ---------- Previous post was at 05:47 AM ----------

So I put an debug. Joint 4 moves:
Code:
bool SSRMS::SetJointAngle(SSRMS::SSRMS_JOINT joint, double angle)
{
	if (angle >= JOINT_SOFTSTOPS[0][joint] && angle <= JOINT_SOFTSTOPS[1][joint]) {
		double pos = linterp(JOINT_LIMITS[0][joint], 0.0, JOINT_LIMITS [1][joint], 1.0, angle);
		//double pos=linterp(RMS_JOINT_LIMITS[0][joint], 0.0, RMS_JOINT_LIMITS[1][joint], 1.0, angle); ssu
		if (activeLEE == 0 && (joint == SHOULDER_YAW || joint == WRIST_YAW)) pos = 1.0 - pos; // yaw joints rotate in different directions depending on which LEE is active
		sprintf_s(oapiDebugString(), 255, "Error: joint %d pos %f", joint, pos);
		SetAnimation(anim_joint[joint], pos);
		joint_angle[joint] = angle;
		arm_moved = true;
		update_camera = true;
		return true;
	}
	else return false;
}
Code:
typedef enum {SHOULDER_ROLL=0, SHOULDER_YAW, SHOULDER_PITCH, ELBOW_PITCH, WRIST_PITCH, WRIST_YAW, WRIST_ROLL} SSRMS_JOINT;


So not sure how/why joint is not changing.

---------- Post added 10-03-18 at 07:21 AM ---------- Previous post was 10-02-18 at 07:57 PM ----------

So I when back to see what the joint values and limits are.
Code:
bool SSRMS::SetJointAngle(SSRMS::SSRMS_JOINT joint, double angle)
{
	//if (angle >= JOINT_SOFTSTOPS[0][joint] && angle <= JOINT_SOFTSTOPS[1][joint])

	sprintf_s(oapiDebugString(), 255, "Error: joint %d pos %f ANGLE %f", joint, JOINT_SOFTSTOPS[0][joint], JOINT_SOFTSTOPS[1][joint]);


	{
		double pos = linterp(JOINT_LIMITS[0][joint], 0.0, JOINT_LIMITS [1][joint], 1.0, angle);
		//double pos=linterp(RMS_JOINT_LIMITS[0][joint], 0.0, RMS_JOINT_LIMITS[1][joint], 1.0, angle); ssu
		//joint = SHOULDER_PITCH;
	//	if (activeLEE == 0 && (joint == SHOULDER_YAW || joint == WRIST_YAW)) pos = 1.0 - pos; // yaw joints rotate in different directions depending on which LEE is active
		sprintf_s(oapiDebugString(), 255, "Error: joint %d STOP1 %f STOP2 %f pos %f angle %f,limit1 %f limit2 %f", joint, JOINT_SOFTSTOPS[0][joint], JOINT_SOFTSTOPS[1][joint], pos, angle, JOINT_LIMITS[0][joint], JOINT_LIMITS[1][joint]);
		SetAnimation(anim_joint[joint], pos);
		joint_angle[joint] = angle;
		arm_moved = true;
		update_camera = true;
		return true;
	}
	//else return false;
}
So there are 7 (0 to 6 ) joints.

Code:
const double JOINT_LIMITS[3][7] = { { -180.0, +180.0, -85.0, +130.0, -180.0, +180.0 }, { -155.0, +155.0, -215.0, +90, -95.0, +130 },{ -180.0, +180.0 } };
//const double JOINT_LIMITS[2][6] = { { -180.0, +180.0, -85.0, +130.0, -180.0, +180.0 }, { -155.0, +155.0, -215.0, +90, -95.0, +130 } };

const double JOINT_SOFTSTOPS[3][7] = { { -177.0, +177.0, -82.0, +126.0, -177.0, +177.0 },{ -151.0, +151.0, -210.0, +85.0, -90.0, +125.0 }, { -177.0, +177.0 } };

	typedef enum {SHOULDER_ROLL=0, SHOULDER_YAW=1, SHOULDER_PITCH=2, ELBOW_PITCH=3, WRIST_PITCH=4, WRIST_YAW=5, WRIST_ROLL=6} SSRMS_JOINT;

But the data I got was different:
limits joint 0 -177,151 soft 180,-155
limits joint 1 -177,151 soft 180, 155
limits joint 2 -82,-210 soft -85,215
limits joint 3 126,85 soft 130,90
limits joint 4 -177,-90 soft -180,-95
limits joint 5 177,125 soft 180,130
limits joint 0 0,0 soft 0,0


//FIXED
I had the array all wrong

Last edited by gattispilot; 10-04-2018 at 01:04 PM.
gattispilot is offline   Reply With Quote
Old 10-09-2018, 10:31 AM   #9
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I am running into an issue with an arm tip. I have a sc3 version and a dll. The attachment values are off on the dll. I have no clue. Arm positions are the same.


Attachment is made here:
Code:
hEEAttach = V()->CreateAttachment(false, SR_JOINT, _V(-0.707107, -0.707107, 0), _V(0.707107, -0.707107, 0), ATTACH_ID);
Here is the arm tip info:
Code:
arm_tip[0] = LEE_POS;//3.518,2.737,-0.21
	arm_tip[1] = _V(4.018, 3.237, -0.21);
	arm_tip[2] = _V(4.018, 2.237, -0.21);
and the sc3:
Code:
TIP_ARM1_1=(3.518,2.737,-0.21)
TIP_ARM1_2=(4.018,3.237,-0.21)
TIP_ARM1_3=(4.018,2.237,-0.21)
So on the arm code if I comment this out the attachment is correct:
Code:
static MGROUP_ROTATE lee_anim(LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip), 5,LEE_POS, _V(0, 0, -1), 0.0);
	anim_lee = CreateAnimation(0.5);
	AddAnimationComponent(anim_lee, 0, 1, &lee_anim, arm1parent);
Code:
pLEE[1]->SetAttachmentParams(arm_tip[0], arm_tip[1]-arm_tip[0], arm_tip[2]-arm_tip[0]);


---------- Post added 10-09-18 at 05:27 AM ---------- Previous post was 10-08-18 at 09:26 PM ----------

This is what I get. The attachment points moves but it is in the wrong place and dir and rot are not normalize.


---------- Post added at 05:31 AM ---------- Previous post was at 05:27 AM ----------

If I comment these lines out the attachment is good but doesn't move
Code:
void LEESystem::SetAttachmentParams(const VECTOR3& pos, const VECTOR3& dir, const VECTOR3& rot) const
{
	//V()->SetAttachmentParams(hBaseAttach, pos, dir, rot);
	//V()->SetAttachmentParams(hEEAttach, pos, dir, rot);
}
gattispilot is offline   Reply With Quote
Old 10-10-2018, 01:01 PM   #10
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I started commented thing out to see where the issue might be:

all vectors were set to 0.0 But I noticed the animation set to start at .4,.41,.715 seem to mess up the attachment

Does that make sense?


Code:
static UINT ShoulderRollGrp[1] = { 31 };
static MGROUP_ROTATE sr_anim(mesh_ssrms, ShoulderRollGrp, 1,SR_JOINT, _V(-0.707107, -0.707107, 0), static_cast<float>((360)*RAD));
anim_joint[SHOULDER_ROLL] = CreateAnimation(0.5);
arm1parent = AddAnimationComponent(anim_joint[SHOULDER_ROLL], 0, 1, &sr_anim);

//static UINT ShoulderYawGrp[1] = { 32 };
//static MGROUP_ROTATE sy_anim(mesh_ssrms, ShoulderYawGrp, 1, SY_JOINT, _V(-0.707107, 0.707107, 0), static_cast<float>((215)*RAD));
//anim_joint[SHOULDER_YAW] = CreateAnimation(0.4);
//arm1parent = AddAnimationComponent(anim_joint[SHOULDER_YAW], 0, 1, &sy_anim, arm1parent);

static UINT ShoulderPitchGrp[1] = { 33 };
static MGROUP_ROTATE sp_anim(mesh_ssrms, ShoulderPitchGrp, 1,SP_JOINT, _V(0, 0, 1), static_cast<float>((360)*RAD));
anim_joint[SHOULDER_PITCH] = CreateAnimation(0.5);
arm1parent = AddAnimationComponent(anim_joint[SHOULDER_PITCH], 0, 1, &sp_anim, arm1parent);

static UINT ElbowPitchGrp[1] = { 34 };
static MGROUP_ROTATE ep_anim(mesh_ssrms, ElbowPitchGrp, 1,EP_JOINT, _V(0, 0, 1), static_cast<float>((310)*RAD));
anim_joint[ELBOW_PITCH] = CreateAnimation(0.5);
arm1parent = AddAnimationComponent(anim_joint[ELBOW_PITCH], 0, 1, &ep_anim, arm1parent);

//static UINT WristPitchGrp[1] = { 35 };
//static MGROUP_ROTATE wp_anim(mesh_ssrms, WristPitchGrp, 1,WP_JOINT, _V(0, 0, 1), static_cast<float>((305)*RAD));
//anim_joint[WRIST_PITCH] = CreateAnimation(0.715);
//arm1parent = AddAnimationComponent(anim_joint[WRIST_PITCH], 0, 1, &wp_anim, arm1parent);

//static UINT WristYawGrp[1] = { 36 };
//static MGROUP_ROTATE wy_anim(mesh_ssrms, WristYawGrp, 1,WY_JOINT, _V(-0.707107, 0.707107, 0), static_cast<float>((225)*RAD));
//anim_joint[WRIST_YAW] = CreateAnimation(0.41);
//arm1parent = AddAnimationComponent(anim_joint[WRIST_YAW], 0, 1, &wy_anim, arm1parent);

static UINT WristRollGrp[6] = { 37, 38, 39, 40, 41, 42 };
static MGROUP_ROTATE wr_anim(mesh_ssrms, WristRollGrp, 6,WR_JOINT, _V(0.707107, 0.707107, 0), static_cast<float>((360)*RAD));
anim_joint[WRIST_ROLL] = CreateAnimation(0.5);
arm1parent = AddAnimationComponent(anim_joint[WRIST_ROLL], 0, 1, &wr_anim, arm1parent);

static MGROUP_ROTATE lee_anim(LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip), 5,LEE_POS, _V(0, 0, -1), 0.0);
anim_lee = CreateAnimation(0.5);
AddAnimationComponent(anim_lee, 0, 1, &lee_anim, arm1parent);
gattispilot is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK


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 06:56 PM.

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.