# c4ooo

Members

88

29 Excellent

## 4 Followers

• Rank
Rocketry Enthusiast

## Profile Information

• Location Night side of Kerbol

## Recent Profile Visitors

1,439 profile views

1. ## Getting Angular Velocity relative to craft. (ΔPitch, ΔRoll, ΔHeading).

@Benjamin Kerman This is what i get when i tried rolling the vessel: (IDK why but Vector3d.ToString() makes it a rainbow...) https://i.imgur.com/fZkVZuo.png Next i tried pitching the vessel down (harder to do accurately then rolling) and got this: https://i.imgur.com/vOJGRm6.png
2. ## Getting Angular Velocity relative to craft. (ΔPitch, ΔRoll, ΔHeading).

The output vector's value's seem kinda meaningless
3. ## Getting Angular Velocity relative to craft. (ΔPitch, ΔRoll, ΔHeading).

How do i orient a craft's angularVelocity vector to extract the ΔPitch, ΔRoll, ΔHeading? Mechjeb does this to orient the attitude vector to get the pitch roll and heading: Vector3d CoM, north, up; Quaternion rotationSurface; CoM = Vessel.CoM; up = (CoM - Vessel.mainBody.position).normalized; north = Vector3d.Exclude(up, (Vessel.mainBody.position + Vessel.mainBody.transform.up * (float)Vessel.mainBody.Radius) - CoM).normalized; rotationSurface = Quaternion.LookRotation(north, up); Vector3d attitude = Quaternion.Inverse(Quaternion.Euler(90, 0, 0) * Quaternion.Inverse(Vessel.GetTransform().rotation) * rotationSurface).eulerAngles; However doing something similar but replacing Vessel.GetTransform().rotation with Vessel.angularVelocity results in what seems like meaningless numbers.
4. ## [Hardware, Plugin] Arduino based physical display + serial port io+ tutorial (10-06-17)

'Angle x 50' would be better do to ease of use I suppose. (The current ratio is Angle x ~91.0222, which isn't an integer as you can see :V ). Although if you would be fine with negative headings (range of -180 to 180), then you can make the ratio 'Angle x 100', and have a resolution of 0.01 degrees. As for the targeting planets issue: since the 'set navball mode' code also uses the "TargetExcists()" function, I assume it is not possible to set the navball to "Target" speed mode or set SAS to "target" mode if you are targeting a planet, not a vessel.
5. ## External Multi-Function Display

This was originally part of this thread but posting it in this subforum is more appropriate. YARK Multifunctional Display is a program that uses the YARK plugin to fetch flight through a TCP connection and display it on virtual instruments situated in widgets. This could be useful if you want to build a simpit with simulated displays or just have extra monitor space. Below is a screenshot of an earlier build: Instruments are situated in "Widget" windows, which can be configured through a console, or by mouse interaction. List of Widgets: NavBall (navball) Attitude Indicator (ati-in) Air Map (airmap) Soyuz NavBall (soyuznavball) Configuring YARK-MFD config.txt is read on startup and tells YARK-MFD the desired window size and connection IP. It is in the following format: IP <IP> <port> winsize <width> <height> start.txt is read next, and contains a list of console commands that configure the initial layout of the widget windows and serves to save the layout between uses. Here is a list of accepted console commands: savestate //saves the state of the windows to the start.txt open <widget name> <locationX> <locationY> <sizeX> <sizeY> //opens the requisted widget at the given location. close <window title> //closes the widget with that window title. (generly window title = widget name) resize <window title> <locationX> <locationY> <sizeX> <sizeY> //sets window to a certain size and location Of course, windows can also be moved resize using mouse drag and drop. (Although there is no way to open new windows without the console yet). The console is opened automaticly so "resize" or "close" should be used to move/close it. (Dont do "open console") NOTE THAT Everything is still very alpha, I am still working on the overall system, adding more widgets, and changing how they render Download / Source YARK-MFD requires at least openGL 3.3, and is currently only compiled for 64 bit windows. YARK-MFD can be downloaded here, and the YARK plugin (required) here. Source code for both YARK and YARK-MFD is here. Compiling YARK-MFD requires SDL2, glm, freetype and glew (see /Lib folder).
6. ## [Hardware, Plugin] Arduino based physical display + serial port io+ tutorial (10-06-17)

@zitronen I sent a pull request, but unfortunately I could not test the code becouse I don't have any arduinos at hand. Should work fine though. I made the 16-bit angles be stored in the range of [-360,360), so that there is no need for negative headings (headings is in the range (0,360] while pitch is in the range (-90,90)). Not sure if this is the best option long term. Edit: I just came to the realization that the Normal Vector's heading (likewise to Radial Vectors pitch and heading) can be calculated easily from the prograde Vector, so there's no need to send it :V That is unless I got something confused again.
7. ## [1.5.x] RasterPropMonitor - still putting the 'A' in IVA (v0.30.5, 11 June 2018)

I have taken a look and I am not sure how the code is supposed to be used. As far as I see, MAS doesn't come with any camera models itself, so is the code meant to use/control cameras from mods like KURS?
8. ## [Hardware, Plugin] Arduino based physical display + serial port io+ tutorial (10-06-17)

@zitronen and others, is there any demand for making the plugin send the Pitch+Heading of the navball vectors? (Prograde, Target, Maneuver and Normal). I recently worked the code out for how to do that (because I am making a TCP-socket based version of this plugin), and would be happy to send a pull request. However, the amount of data needed to be sent is quite large, adding up to a total of 7 floats (the Normal vector always has a pitch of zero, so need to send that), or 28 bytes. This size could be cut down by replacing floats with something smaller and less accurate, such as a 2-byte fixed point representation, but that's still 14 bytes. Edit: Well seems like @naru1305 does :V (I didn't bother reading the thread before posting) Edit 2: anyways here's the code to calculate pitch+heading of the vectors by the way:
9. ## The official unoffical "help a fellow plugin developer" thread

@DMagic well, for the target vectors I suppose I could just subtract the target position from the vessel position. I just don't know how to "orient" this resulting vector so that I can sensibly draw it on my external navball. Edit: Well, it took me all morning but I figured out how to calculate the Pitch and Heading (relative to the surface/navball) of the prograde vector given the vessel's velocity vector (which is in world space). Once I got it though, it seemed easier then I expected. In the code bellow, AV is the active vessel:
10. ## The official unoffical "help a fellow plugin developer" thread

Is there any "official" way on how to get the different vectors from the navball (Pro/Retrograde, radialIn/Out, Anti/Normal etc)? I have found some old forum posts (one and two) but the github links that are there are dead. I have also found this code on github, which seems to get the NavBall class through GameObject.Find(""); but when I try the same method, I get a null object. Do I have to manually calculate the vectors, or is there a way to somehow read them from somewhere? Edit: I want the navball vectors because I want to render a navball in a separate desktop application. I already have the navball pitch/yaw/roll rotation correctly rendered, now I just need the vectors.
11. ## Yet Another Remote Kontroller

OK so, I pushed the most recent code to github. (Well actually, I haven't pushed most of the Client because it uses a large SDL/openGL wrapper I wrote, and I think I will make that a separate repo.<sidetrack> All my c++ openGL projects use this wrapper in different stages of its development, and because I was always simply copy and pasting the wrapper from the previous project to the next, the whole thing is a huge mess. <sidetrack>) https://github.com/c4ooo/YARK/tree/master/YARK_CLIENT/YARK_CLIENT/Client contains a very simple c++ TCP client to receive data from the plugin. If you wanted to use that code, you would have to write a main method, #including Client.h, and in which you would create a new Client() object , passing the appropriate params to the constructor. Once Client.state is equal to TCPCLIENT_CONNECTED, you can start reading the appropriate data from Client.status (the "static" data packet) and Client.dataIn (the "dynamic" data packet) and writing to Client.CP (the control packet). To actually send the control packet you need to call Client.SendControls(). The structs are defined in: https://github.com/c4ooo/YARK/blob/master/YARK_CLIENT/YARK_CLIENT/Client/Struts.h Yea, I know everything is messy and confusing right now, but I will be working to clean it up as well as writing a proper documentation and stuff. Ohh and, the plugin's server is started on port 9999, I will make this configurable ASAP. Edit: Just a screenshot:
12. ## Yet Another Remote Kontroller

I will try to have to have more or less finalized documentation by the end of this week. (Tomorrow I plan on fixing how the desktop-client renders the navball) Right now, the current setup acts this way: Once the client connects, it will automatically start receiving packets from the server. Each packet starts with a 3 byte header. The first two bytes are always 0xDEAD (lame, I know ), and the third byte identifies what type of packet it is. The first type (0x01) is a "Status Packet", which notifies the client of whether there is a vessel currently in flight, and what name of that vessel is, and other "static" data about the vessel. It gets sent when the client first connects, when the flight starts/ends, or when the vessel is switched. The second type of packet (0x02) is the "Vessel Data Packet" which gets sent every frame, as long as there is a vessel in flight, and holds "dynamic" data about the vessel such as altitude, attitude, fuel, etc.