funkheld

Members
  • Content Count

    35
  • Joined

  • Last visited

Community Reputation

2 Neutral

About funkheld

  • Rank
    Rocketeer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi good afternoon. How is laserdist with krpc? Thank you. greeting
  2. Hi good afternoon. with kos i have this laserdist on the run with python. how can you please implement the program for krpc? Thank you. Greeting set laser TO SHIP:MODULESNAMED("LaserDistModule")[0]. until false { print "Distanz = " + round(laser:Getfield("Distance"),1) + " Meter " at(0,5). wait 0.2. }
  3. funkheld

    [1.6.1] kOS v1.1.6.3 : kOS Scriptable Autopilot System

    Hello thanks for info. greeting
  4. funkheld

    [1.6.1] kOS v1.1.6.3 : kOS Scriptable Autopilot System

    Hi good afternoon. I built two computers at the Pegasus: - Pegasus CPU: CompoMax (test) - Pegasus CPU: CompoMax (test1) How can I load a program in each one now? test.ks and test1.ks Thank you. greeting
  5. funkheld

    [1.6.1] kOS v1.1.6.3 : kOS Scriptable Autopilot System

    Thanks for your help. I can not do that with my 70 years. Can you please help me with a little demo? Many Thanks. greeting
  6. funkheld

    [1.6.1] kOS v1.1.6.3 : kOS Scriptable Autopilot System

    Hi good afternoon. can you start with kos two programs independently please? Thank you. greeting program 1: until false { PRINT ":". PRINT ROUND(SHIP:ALTITUDE,0). PRINT ":". PRINT ROUND(SHIP:APOAPSIS,0). PRINT ":". PRINT ROUND(SHIP:PERIAPSIS,0). PRINT ":". PRINT ROUND(SHIP:VELOCITY:SURFACE:MAG,1). PRINT ":". wait 0.1. } program 2: until false { wait 0.1. }
  7. Hi good afternoon. I play with kRPC and it works wonderfully with Python 2.7.15 and Python 3.7. und Kerbal Space Program 1.6.1 All four test programs do not work from kRPC.MechJeb -------------------------- - pip install krpc is ok. --------------------------- Now I wanted to test the kerbal kRPC.MechJeb: -Mechjeb2 installed. -Copy KRPC.MechJeb.dll to Kerbal Space Program / GameData / kRPC directory. I tested two addresses in kRPC. this address : ----------------------------- conn = krpc.connect(name='Launch into orbit', address='127.0.0.1', rpc_port=1000, stream_port=1001) ----------------------------- not function ! this addres : ----------------------------- conn = krpc.connect(name='Launch into orbit', address='127.0.0.1', rpc_port=50000, stream_port=50001) ----------------------------- not function ! program LaunchIntoOrbit.py import krpc conn = krpc.connect(name='Launch into orbit', address='127.0.0.1', rpc_port=1000, stream_port=1001) sc = conn.space_center mj = conn.mech_jeb ascent = mj.ascent_autopilot #All of these options will be filled directly into Ascent Guidance window and can be modified manually during flight. ascent.desired_orbit_altitude = 100000 ascent.desired_inclination = 6 ascent.force_roll = True ascent.vertical_roll = 90 ascent.turn_roll = 90 ascent.autostage = True ascent.enabled = True sc.active_vessel.control.activate_next_stage() #launch the vessel with conn.stream(getattr, ascent, "enabled") as enabled: enabled.rate = 1 #we don't need a high throughput rate, 1 second is more than enough with enabled.condition: while enabled(): enabled.wait() print("Launch complete!") conn.close() errormeldung with LaunchIntoOrbit.py : ------------------------------------------- f:\python27>python.exe f:\python27\pebi-py\LaunchIntoOrbit.py Traceback (most recent call last): File "f:\python27\pebi-py\LaunchIntoOrbit.py", line 9, in <module> ascent = mj.ascent_autopilot File "<string>", line 1, in <lambda> File "f:\python27\lib\site-packages\krpc\client.py", line 163, in _invoke raise self._build_error(response.results[0].error) krpc.types.MJServiceException: Exception has been thrown by the target of an invocation.: Non-static field requires a target Server stack trace: at KRPC.MechJeb.ExtensionMethods.TypeExtensions.CreateInstance[AscentAutopilot] (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 at KRPC.MechJeb.MechJeb.GetComputerModule[AscentAutopilot] (System.Object[] modules, Int32 id, System.Object[] args) [0x00000] in <filename unknown>:0 at KRPC.MechJeb.MechJeb.GetComputerModule[AscentAutopilot] (System.Object[] modules, Int32 id) [0x00000] in <filename unknown>:0 at KRPC.MechJeb.MechJeb.get_AscentAutopilot () [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 ---------------------------------------- thanks. greeting
  8. funkheld

    KRPC.MechJeb not funktion.

    yes i have pip install. ------------------------------- Did you use pip install krpc to install it? ? _____________________ greetin g
  9. hello, good day. all other programs with krpc 0.48 is ok. I have ksp 1.6.1 and python 2.7. this not funktion: LaunchIntoOrbit.py - Mechjeb2 installiert - Copy KRPC.MechJeb.dll to Kerbal Space Program/GameData/kRPC directory. errormeldung: ------------------------------------------------------ f:\python27>python.exe f:\python27\pebi-py\LaunchIntoOrbit.py Traceback (most recent call last): File "f:\python27\pebi-py\LaunchIntoOrbit.py", line 9, in <module> ascent = mj.ascent_autopilot File "<string>", line 1, in <lambda> File "f:\python27\lib\site-packages\krpc\client.py", line 163, in _invoke raise self._build_error(response.results[0].error) krpc.types.MJServiceException: Exception has been thrown by the target of an invocation.: Non-static field requires a target Server stack trace: at KRPC.MechJeb.ExtensionMethods.TypeExtensions.CreateInstance[AscentAutopilot] (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 at KRPC.MechJeb.MechJeb.GetComputerModule[AscentAutopilot] (System.Object[] modules, Int32 id, System.Object[] args) [0x00000] in <filename unknown>:0 at KRPC.MechJeb.MechJeb.GetComputerModule[AscentAutopilot] (System.Object[] modules, Int32 id) [0x00000] in <filename unknown>:0 at KRPC.MechJeb.MechJeb.get_AscentAutopilot () [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 ---------------------------------------------- mport krpc conn = krpc.connect(name='test', address='127.0.0.1', rpc_port=1000, stream_port=1001) sc = conn.space_center mj = conn.mech_jeb ascent = mj.ascent_autopilot #All of these options will be filled directly into Ascent Guidance window and can be modified manually during flight. ascent.desired_orbit_altitude = 100000 ascent.desired_inclination = 6 ascent.force_roll = True ascent.vertical_roll = 90 ascent.turn_roll = 90 ascent.autostage = True ascent.enabled = True sc.active_vessel.control.activate_next_stage() #launch the vessel with conn.stream(getattr, ascent, "enabled") as enabled: enabled.rate = 1 #we don't need a high throughput rate, 1 second is more than enough with enabled.condition: while enabled(): enabled.wait() print("Launch complete!") conn.close() thanks greeting.
  10. here is the picture for krpc from funkheld: https://www.mikrocontroller.net/topic/467950#5721777 greeting
  11. Hi good afternoon. have now this krpc with the arduino mega2560 driven. I can do the control with the keypad throttle +- and stage. this is just a test. you can move much more with the mega2560. on the mega2560 I have serial2 usb-ttl) to the pc (python-krpc) and the data output (data_velo, data_alti, data_apoa) I do about the serial port of the mega2560 with what you previously synonymous program transmits. the data can be later synonymous to a lcd display output, which is connected to the mega2560. the throttle and stage control also works with one bluetooth module hc-05 at the mega2560 and a table. I wrote program android with B4A. greeting Code for Python 2.7 : import time import krpc import serial conn = krpc.connect(name='Sub-orbital flight', address='127.0.0.1', rpc_port=1000, stream_port=1001) vessel = conn.space_center.active_vessel ref_frame = conn.space_center.ReferenceFrame.create_hybrid( position=vessel.orbit.body.reference_frame, rotation=vessel.surface_reference_frame) time.sleep(1) port = "com6" ser = serial.Serial(port, 9600, timeout=0) def throttle_func(par): vessel.control.throttle = float(par) return def stage_func(): vessel.control.activate_next_stage() return t=0 data_alti=0 data_velo=0 data_apoa=0 while True: time.sleep(0.1) s = ser.readline() if s == '1': t=t+0.1 throttle_func(t) if s == '2': t=t-0.1 throttle_func(t) if s == '3': stage_func() data_velo=round(vessel.flight(ref_frame).speed) data_alti =round(vessel.flight().mean_altitude) data_apoa =round(vessel.orbit.apoapsis_altitude) ser.write(str(data_velo)+':'+str(data_alti)+':'+str(data_apoa)+'\n\r') con.close() conn.close() Code for Arduino Mega2560 mit Keypad: #include <Keypad.h> const byte numRows= 4; const byte numCols= 4; char keymap[numRows][numCols]= { {'0', '4', '8', 'C'}, {'1', '5', '9', 'D'}, {'2', '6', 'A', 'E'}, {'3', '7', 'B', 'F'} }; byte rowPins[numRows] = {53,51,49,47}; //Rows 0 to 3 byte colPins[numCols]= {45,43,41,39}; //Columns 0 to 3 byte inbyte; byte throttle_p; byte throttle_m; byte stage; Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols); void setup() { Serial2.begin(9600); Serial.begin(9600); throttle_p=1; throttle_m=2; stage=3; } void loop() { char keypressed = myKeypad.getKey(); if (Serial2.available()){ inbyte = Serial2.read(); Serial.write(inbyte); } if (keypressed =='0') { Serial2.print(throttle_p); } if (keypressed =='1') { Serial2.print(throttle_m); } if (keypressed =='2') { Serial2.print(stage); } } Code for Arduino Mega2560 mit hc-05: byte inbyte; byte throttle_p; byte throttle_m; byte stage; void setup() { Serial1.begin(9600); Serial2.begin(9600); Serial.begin(9600); throttle_p=1; throttle_m=2; stage=3; } void loop() { if (Serial2.available()) { inbyte = Serial2.read(); Serial.write(inbyte); } if (Serial1.available()) { inbyte = Serial1.read(); if(inbyte == 50) { Serial2.print(throttle_p); } if(inbyte == 51) { Serial2.print(throttle_m); } if(inbyte == 52) { Serial2.print(stage); } } }
  12. Hi good afternoon. I wanted to stop the trottle with A0. How is that possible? greeting
  13. Hi good afternoon. throttle = map(pitchRead, 0, 1023, 0, 32767); what does this table mean? I want to set the trottle with it. it does not work. the word of A0 is 23-1017. greeting
  14. - hello good day. the errormeldung from : KerbalSimpitHelloWorld. Greeting ---------------------------------------------------------------------------------------------------- Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)" C:\Users\pebi\Documents\Arduino\libraries\kerbalsimpit-arduino\examples\KerbalSimpitHelloWorld\KerbalSimpitHelloWorld.ino: In function 'void loop()': KerbalSimpitHelloWorld:51: error: invalid conversion from 'const char*' to 'byte* {aka unsigned char*}' [-fpermissive] mySimpit.send(ECHO_REQ_MESSAGE, "low", 4); ^ In file included from C:\Users\pebi\Documents\Arduino\libraries\kerbalsimpit-arduino\examples\KerbalSimpitHelloWorld\KerbalSimpitHelloWorld.ino:11:0: C:\Users\pebi\Documents\Arduino\libraries\kerbalsimpit-arduino\src/KerbalSimpit.h:72:8: error: initializing argument 2 of 'void KerbalSimpit::send(byte, byte*, byte)' [-fpermissive] void send(byte messageType, byte msg[], byte msgSize); ^ KerbalSimpitHelloWorld:53: error: invalid conversion from 'const char*' to 'byte* {aka unsigned char*}' [-fpermissive] mySimpit.send(ECHO_REQ_MESSAGE, "high", 5); ^ In file included from C:\Users\pebi\Documents\Arduino\libraries\kerbalsimpit-arduino\examples\KerbalSimpitHelloWorld\KerbalSimpitHelloWorld.ino:11:0: C:\Users\pebi\Documents\Arduino\libraries\kerbalsimpit-arduino\src/KerbalSimpit.h:72:8: error: initializing argument 2 of 'void KerbalSimpit::send(byte, byte*, byte)' [-fpermissive] void send(byte messageType, byte msg[], byte msgSize); ^ C:\Users\pebi\Documents\Arduino\libraries\kerbalsimpit-arduino\examples\KerbalSimpitHelloWorld\KerbalSimpitHelloWorld.ino: In function 'void messageHandler(byte, byte*, byte)': KerbalSimpitHelloWorld:70: error: invalid conversion from 'byte* {aka unsigned char*}' to 'const char*' [-fpermissive] if (strcmp(msg, "low")) { ^ In file included from F:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:25:0, from sketch\KerbalSimpitHelloWorld.ino.cpp:1: f:\arduino\hardware\tools\avr\avr\include\string.h:125:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp(const char *, const char *) __ATTR_PURE__; ^ exit status 1 invalid conversion from 'const char*' to 'byte* {aka unsigned char*}' [-fpermissive] --------------------------------------------------------------------------------------------- Dieser Bericht wäre detaillierter, wenn die Option "Ausführliche Ausgabe während der Kompilierung" in Datei -> Voreinstellungen aktiviert wäre. Hi good afternoon. this command is different than in the description. KerbalSimpitAltitudeTrigger.ino : void messageHandler(byte messageType, byte msg[], byte msgSize) { switch(messageType) { case ALTITUDE_MESSAGE: ........ https://kerbalsimpit-arduino.readthedocs.io/en/stable/quickstart.html void myCallbackHandler(byte messageType, byte mesesage[], byte messageSize) { switch(messageType) { case ALTITUDE_MESSAGE: Greeting