Jump to content

[1.0.4] (2015-07-04) Telemachus – Telemetry and Flight Control in the Web Browser


Rich

Recommended Posts

Hi Richard,

After perusing the MechJeb sources, it sounds like a bunch of work to implement this in Telemachus. I can do the math in my script, however I would be greatful if you could expose a few extra parameters over the Telemachus API, namely o.referenceBody.gravParameter and o.epoch. Here is a snippet of what I think the changes entail to DataLinkHandlers.cs:


registerAPI(new PlotableAPIEntry(
dataSources => { return dataSources.vessel.orbit.epoch; },
"o.epoch", "Epoch", formatters.Default, APIEntry.UnitType.TIME));

and


registerAPI(new PlotableAPIEntry(
dataSources => { return dataSources.vessel.orbit.referenceBody.gravParameter; },
"b.o.gravParameter", "Epoch", formatters.Default, APIEntry.UnitType.TIME));

I have attempted to make the changes and recompile using MonoDevelop, however I get the following error:

Unable to compile (/usr/bin/resgen2) /home/ttb/sources/Telemachus_working/Servers/Servers/Properties/Resources.resx to .resources.

Reason:

Error: Invalid ResX input.

Position: Line 123, Column 5.

Inner exception: Encoding name 'gb2312' not supported

Parameter name: name

Thanks

Tim

Link to comment
Share on other sites

Hello, I love your mod! I have a suggestion: it is to have the orbital order for the rocket on a screen and another screen the telemetry or the orbital view. Is this technically possible?

thank you.

Link to comment
Share on other sites

Hmm, Rich, what does o.timeToTransition1 and o.timeToTransition2 show, exactly? I can't get the values to correspond to anything really.

I thought they corresponded to the time at the start and end of the current patch? For example, if at the end of your next patch you are changing into the Mun's SOI, then one of those values should give the time to SOI change.

Hi Richard,

After perusing the MechJeb sources, it sounds like a bunch of work to implement this in Telemachus. I can do the math in my script, however I would be greatful if you could expose a few extra parameters over the Telemachus API, namely o.referenceBody.gravParameter and o.epoch. Here is a snippet of what I think the changes entail to DataLinkHandlers.cs:


registerAPI(new PlotableAPIEntry(
dataSources => { return dataSources.vessel.orbit.epoch; },
"o.epoch", "Epoch", formatters.Default, APIEntry.UnitType.TIME));

and


registerAPI(new PlotableAPIEntry(
dataSources => { return dataSources.vessel.orbit.referenceBody.gravParameter; },
"b.o.gravParameter", "Epoch", formatters.Default, APIEntry.UnitType.TIME));

I have attempted to make the changes and recompile using MonoDevelop, however I get the following error:

Unable to compile (/usr/bin/resgen2) /home/ttb/sources/Telemachus_working/Servers/Servers/Properties/Resources.resx to .resources.

Reason:

Error: Invalid ResX input.

Position: Line 123, Column 5.

Inner exception: Encoding name 'gb2312' not supported

Parameter name: name

Thanks

Tim

I am not familiar with MonoDevelop, but I can add in those two new API calls for you. I plan to do a release this coming Friday/Saturday.

Hello, I love your mod! I have a suggestion: it is to have the orbital order for the rocket on a screen and another screen the telemetry or the orbital view. Is this technically possible?

thank you.

Hi Doudou, please could you clarify what you mean by "orbital order"?

Link to comment
Share on other sites

I am not familiar with MonoDevelop, but I can add in those two new API calls for you. I plan to do a release this coming Friday/Saturday.

Mo prob re MonoDevelop, I was just playing around with it. I'm a Linux bloke so was trying to compile on Linux :)

Just spotted a error in the code I quoted:


registerAPI(new PlotableAPIEntry(
dataSources => { return dataSources.vessel.orbit.referenceBody.gravParameter; },
"b.o.gravParameter", "Epoch", formatters.Default, APIEntry.UnitType.TIME));

I think the APIEntry.UnitType shouldn't be TIME, it would seem the KSP API returns a float, not sure what this corresponds to in your code.

Thanks a bunch, looking forward to your update!

Cheers

Tim

P.S. C# does my head in :)

Link to comment
Share on other sites

I've skimmed the thread and seen mentions of camera feeds in Telemachus - is this feature being worked on / possible with another plugin? I would love to have an external camera feed.

I apologize if this has been explained earlier in the thread, I admittedly did not take the time to read all posts in detail.

Link to comment
Share on other sites

I thought they corresponded to the time at the start and end of the current patch? For example, if at the end of your next patch you are changing into the Mun's SOI, then one of those values should give the time to SOI change.

I tested several orbits which had encounters with Mun, Minmus or just escaped Kerbin into Kerbol orbit, and none of them ever had any correlation to the values of o.timeToTransition1 or o.timeToTransition2. I also noted that they were both always the same number. This was the reason for my original question, I was wondering if I was misunderstanding the name.

I decided to go back and double check my math and code, and my numbers correctly show what is represented in the API, assuming the number given is in seconds. I did some more double checking and found that while the number doesn't correspond to any transition between spheres of influence, it DOES very closely correspond to the time at which the vessel crosses the orbit of Mun! The only way to check it easily was to visually place a maneuver node near where my trajectory crossed that orbit, with the following results :

OrwoJy5.jpg

Link to comment
Share on other sites

Addon:

This has me super confused. The numbers have been bothering me because there is no rational reason for it to display crossing an arbitrary altitude. Ran this same test again, but with an orbit that has an encounter with Mun, but never crosses the orbit. The results do not support my previous post at all. I then altered my orbit and watched the SOI and o.timeToTransition1/2 change... Well, see for yourself. I am stumped :D

dZAGNlx.jpg

Link to comment
Share on other sites

I've skimmed the thread and seen mentions of camera feeds in Telemachus - is this feature being worked on / possible with another plugin? I would love to have an external camera feed.

I apologize if this has been explained earlier in the thread, I admittedly did not take the time to read all posts in detail.

Not currently, but I have just completed the first release of a web socket server which makes this feature possible to implement in a satisfactory way.

Addon:

This has me super confused. The numbers have been bothering me because there is no rational reason for it to display crossing an arbitrary altitude. Ran this same test again, but with an orbit that has an encounter with Mun, but never crosses the orbit. The results do not support my previous post at all. I then altered my orbit and watched the SOI and o.timeToTransition1/2 change... Well, see for yourself. I am stumped :D

http://i.imgur.com/dZAGNlx.jpg

I am clueless also ..., maybe I can ask one of the devs.

Development Note

Telemachus 1.4.17.0 has been released. Grab the install files and the change log here. No new usable features, but the web socket server is at its first release so I though I would distribute it for feedback. Here is the web socket server documentation

Edited by Rich
Link to comment
Share on other sites

Hello, I am having trouble getting this to work on a different computer than the one running KSP. I open the Telemachus default link on the main PC, and it runs fine. I open the same link on my Laptop, and it can't connect at all. Both computers are connected to the same internet, and I haven't tried port forwarding yet. The default link is different than my external IP, if that is the problem, how would I change that?

Link to comment
Share on other sites

Telemachus 1.4.17.0 has been released. Grab the install files and the change log here. No new usable features, but the web socket server is at its first release so I though I would distribute it for feedback. Here is the web socket server documentation

Seems to be working ok! I haven't got any metrics to compare performance yet, but using sockets has simplified a lot of the code I needed for adding/removing modules without a refresh. I have however found a few bugs in transitioning already and I will report back once I've had a bit more of a play.

Hello, I am having trouble getting this to work on a different computer than the one running KSP. I open the Telemachus default link on the main PC, and it runs fine. I open the same link on my Laptop, and it can't connect at all. Both computers are connected to the same internet, and I haven't tried port forwarding yet. The default link is different than my external IP, if that is the problem, how would I change that?

The default ip should be 127.0.0.1 when run locally that will work only on the main PC. Local network ip's will usually begin with either 10.1.1. or 192.168.1. If you want to connect from another computer or device you will need the ip that the router assigns for your main pc on the network to connect to it. Most routers have a DHCP client list that is somewhere in the settings or alternatively you can use ipconfig /all in command prompt on the main pc and look for the assigned ipv4 address there. If you can make the IP the router assigns to your main pc static via that list that would be ideal (so it doesn't change at any point in the future).

You shouldn't need to do any port forwarding unless you want remote connections beyond your network to your router. It's possible however that a firewall or anti-virus software is blocking port connections (Telemachus uses 8085 in the new build), so best to check that too!

Edited by Sli
Link to comment
Share on other sites

Ok, so I had a bit of a play tonight and these are the issues that cropped up. Please feel free to correct me if any of it is a bit of occasional coding derpiness creeping in.

- r.resource[LiquidFuel] and r.resourceMax[LiquidFuel] don't appear to be parsed right. (LiquidFuel as an example). I get "r.resource":-1 and "r.resourceMax":-1 returned, which indicates the content of the square brackets is being cropped off. Now this may be due to the fact I am using JSON.stringify to prepare the data before using the websocket.send(data) function, but since the socket requires an array for the value of "+" I can't see how else to send those resource api strings.

- RCS, SAS and Light button state calls return "" : 1 or "" : 2 when the game is paused, rather than a true or false state.

- n.roll only returns 0 as a value?

- I am getting very occasional timeouts where the server seems to stop completely and it involves a reboot of ksp in order to get it going again. I haven't been able to replicate this consistently yet though.

Hope this helps!

Edited by Sli
Link to comment
Share on other sites

Hi every one. That mod is just amazing ! I love it. However, I can't get replies from websocket. I connect to it, with no error, I try to subscribe to data, no error again, but I never receive any response.

I've noticed that in the forum specify the following command to subscribe : {"subscribe": ["v.altitude","v.name"]} and on the wiki pages, the following syntax : {"+": ["v.altitude"]}.

I was not able to receive any message from the web socket. Is this OK ?

Link to comment
Share on other sites

Would it be possible to add support for other MechJeb features like ascent autopilot, maneuver node planner, thrust limiter, etc.

It is certainly possible, but it isn't a priority feature right now.

How does the 'f.setThrottle' command works ? I tried it like this 'f.setThrottle[x]' and it's not working ...

I might have broken it with the last update; I plan to do a bug fix release this weekend so I will check it out then.

Hi every one. That mod is just amazing ! I love it. However, I can't get replies from websocket. I connect to it, with no error, I try to subscribe to data, no error again, but I never receive any response.

I've noticed that in the forum specify the following command to subscribe : {"subscribe": ["v.altitude","v.name"]} and on the wiki pages, the following syntax : {"+": ["v.altitude"]}.

I was not able to receive any message from the web socket. Is this OK ?

Are you using a web socket framework which supports the RFC6455 protocol?

Link to comment
Share on other sites

Hi every one. That mod is just amazing ! I love it. However, I can't get replies from websocket. I connect to it, with no error, I try to subscribe to data, no error again, but I never receive any response.

I've noticed that in the forum specify the following command to subscribe : {"subscribe": ["v.altitude","v.name"]} and on the wiki pages, the following syntax : {"+": ["v.altitude"]}.

I was not able to receive any message from the web socket. Is this OK ?

I have been using the "+" call without any issues. Do you have a ws.onclose(function() { console.log('connection closed'); } set and is this being triggered? Another option is to open up chrome dev tools, go network tab and refresh the page > find the entry called "data link" click and look at the headers (if there are any). The headers can be useful. Also be sure you are not sending bad requests at any stage post-connection. If you send a subscribe key without an array value (so "+": "v.altitude" instead of "+":["v.altitude"]) I have found it has a habit of just stopping completely.

Sometimes it requires a complete reboot of KSP in order to get rolling again. I have had lots of instances where the server just stops completely that seem to happen periodically when there is no activity for a long time. (It does not seem consistent though).

Link to comment
Share on other sites

Hello, thank you for your replies...

I'm running KSP under a win7 system and I've just read that Win7 cannot run a web socket server. The problem might come from that...

That is referring to web sockets which come with the .NET framework. The web sockets Telemachus uses are custom built, and they do work on Windows 7 because I develop Telemachus on this OS.

What application/code are you using to connect to the web sockets?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...