Jump to content

TheRedColossus

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by TheRedColossus

  1. I said some bullexcrementss. The code that I showed works very well. It just that I didn't know how to correctly interpret the returned data. So now, its works fine but I still don't know how to do the same with the prograd, retrograd, target, etc.. Thanks angain for your help. NB : Nice censorbot btw XD
  2. Thanks for your answer but these values seem to be linked to the vessel trajectory but not to the vessel orientation.
  3. I don't speak english fluently HI ! I would like to know how to obtain the spaceship orientation (pitch, yaw, roll) for display a custom navball on my dashboard. I found this code here but it doesn't works very well (it indicates the same orientation for differents orientations) : private Quaternion updateHeadingPitchRollField (Vessel v) { Vector3d CoM, north, up; Quaternion rotationSurface; CoM = v.CoM; up = (CoM - v.mainBody.position).normalized; north = Vector3d.Exclude(up, (v.mainBody.position + v.mainBody.transform.up * (float)v.mainBody.Radius) - CoM).normalized; rotationSurface = Quaternion.LookRotation(north, up); return Quaternion.Inverse(Quaternion.Euler(90, 0, 0) * Quaternion.Inverse(v.GetTransform().rotation) * rotationSurface); } Quaternion attitude = updateHeadingPitchRollField(ActiveVessel); float pitch = (float) ((attitude.eulerAngles.x > 180) ? (360.0 - attitude.eulerAngles.x) : -attitude.eulerAngles.x); float yaw = (float) attitude.eulerAngles.y; float roll = (float) ((attitude.eulerAngles.z > 180) ? (attitude.eulerAngles.z - 360.0) : attitude.eulerAngles.z); And if it possible, I would like to know also, how to obtain the orientation of the prograde, the normal, the radial-in, the maneuver and the target. I apologies for all these questions but I didn't found a complete documentation on the subject. Thanks.
  4. Ok thanks, it works very good ! But I needed to add some other classes : PartExtensions Averager ForceAccumulator Pool CelestialBodies LogMsg MyLogger Thanks a lot !
  5. Sorry for my bad english : I don't speak it fluently. OS : Windows 10 (x64) - KSP version : 1.3.0.1804 Hi ! I want to obtain the deltaV for display it on the screen of my dashboard that I am making. I've had different ideas : To recover the deltaV from another add-on like Kerbal Engineer REDUX but I don't know ho to do that if it possible. To calculate it. I've already start to program a class that calculate it, but for finish it, I need to know how to know if a part is a thruster or not, and if it is, how can I get : Its type (LiquidFuel+Oxidizer or LiquidFuel+IntakeAir or Xenon) Its Isp Its thrust in vaccum or in athmosphere. Thanks.
  6. Ok thanks man ! It works fine and in the two directions : input & output ! So I'll write the program directly in C# because it's cleaner and I'll show you my advancement soon.
  7. Are you talking about that ? What do I have to do ? Sorry for my dumb questions but I'm a newbie in C# programmation, like as I said : I'm more at ease in Java.
  8. Thanks again ! Yes but even if I use ByteToRead() it still doesn't works (return value is always 0). I don't understand what you mean. If I use the Mono IDE it will works ? In all cases when I declare outside of a method a SerialPort from System.IO.Ports my addon does't start.
  9. It's the first time that I hear about a plugin that allows to control KSP from another program ! So I'll write my application in Java (a language where I'm more at ease). Thanks for showed me KRPC !
  10. Yes. I already tried to use OpenNETCF.IO.Ports but when I use it, I can send data to my Arduino but not receive data from the Arduino (port.BytesToRead is always equals at 0). Same problem when I use the addon KSPSerialIO by zitronen : no data is received. I heard that the problem can come from Windows 10. So is there a solution (without change the OS) ?
  11. Sorry for my English (I don't speak it fluently). OS : Windows 10 - KSP version : 1.3.0.1804 Hi ! I made this program that works fine : using UnityEngine; using System.IO.Ports; namespace DashboardDriver { [KSPAddon (KSPAddon.Startup.MainMenu, false)] class DashboardDriver : MonoBehaviour { public void Start() { Debug.Log ("ADDON WORKS !"); } } } Even if I had the line SerialPort port; before Debug.Log ("ADDON WORKS !"); But, when I declare a SerialPort outside a method like this : using UnityEngine; using System.IO.Ports; namespace DashboardDriver { [KSPAddon (KSPAddon.Startup.MainMenu, false)] class DashboardDriver : MonoBehaviour { private SerialPort port; //here public void Start() { Debug.Log ("ADDON WORKS !"); } } } The addon doesn't works (I don't see [AddonLoader]: Instantiating addon 'DashboardDriver' from assembly 'Dashboard driver' or ADDON WORKS ! in the console). I never see a thing like this before and I don't know how to declare the SerialPort. So I ask you for an answer. Thanks.
×
×
  • Create New...