{"action":"created","issue":{"url":"https://api.github.com/repos/dronefleet/mavlink/issues/15","repository_url":"https://api.github.com/repos/dronefleet/mavlink","labels_url":"https://api.github.com/repos/dronefleet/mavlink/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/dronefleet/mavlink/issues/15/comments","events_url":"https://api.github.com/repos/dronefleet/mavlink/issues/15/events","html_url":"https://github.com/dronefleet/mavlink/issues/15","id":375473819,"node_id":"MDU6SXNzdWUzNzU0NzM4MTk=","number":15,"title":"Problem with mavlink2 deserialization","user":{"login":"kgmormylo","id":42807304,"node_id":"MDQ6VXNlcjQyODA3MzA0","avatar_url":"https://avatars2.githubusercontent.com/u/42807304?v=4","gravatar_id":"","url":"https://api.github.com/users/kgmormylo","html_url":"https://github.com/kgmormylo","followers_url":"https://api.github.com/users/kgmormylo/followers","following_url":"https://api.github.com/users/kgmormylo/following{/other_user}","gists_url":"https://api.github.com/users/kgmormylo/gists{/gist_id}","starred_url":"https://api.github.com/users/kgmormylo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgmormylo/subscriptions","organizations_url":"https://api.github.com/users/kgmormylo/orgs","repos_url":"https://api.github.com/users/kgmormylo/repos","events_url":"https://api.github.com/users/kgmormylo/events{/privacy}","received_events_url":"https://api.github.com/users/kgmormylo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2018-10-30T12:53:48Z","updated_at":"2018-11-01T13:19:45Z","closed_at":null,"author_association":"NONE","body":"I'v met another problem.\r\nI plug my APM. APM start send me message. I see that is mav2 message because i see method From2 of MavlinkPacket work.\r\nBut after some portion of message program terminated with error.\r\n\r\n```\r\nConsole output\r\n\r\nStart\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=Attitude{timeBootMs=6470765, roll=0.018246904, pitch=0.14143202, yaw=-1.2641025, rollspeed=8.0544874E-4, pitchspeed=2.0475686E-4, yawspeed=-8.0993585E-4}}\r\nfromV1\r\nMavlinkPacket constructor\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=HighresImu{timeUsec=null, xacc=1.400253, yacc=-0.17800356, zacc=-9.915399, xgyro=8.0544874E-4, ygyro=2.0475686E-4, zgyro=-8.0993585E-4, xmag=0.154, ymag=0.80631995, zmag=0.67248, absPressure=101924.0, diffPressure=0.0, pressureAlt=-49.74959, temperature=41.68, fieldsUpdated=7167}}\r\nfromV2\r\nMavlinkPacket constructor\r\n\r\nException in thread \"main\" java.lang.ArrayIndexOutOfBoundsException\r\n\tat java.lang.System.arraycopy(Native Method)\r\n\tat io.dronefleet.mavlink.serialization.payload.reflection.ReflectionPayloadDeserializer.lambda$5(ReflectionPayloadDeserializer.java:57)\r\n\tat java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)\r\n\tat java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)\r\n\tat java.util.ArrayList.forEach(Unknown Source)\r\n\tat java.util.stream.SortedOps$RefSortingSink.end(Unknown Source)\r\n\tat java.util.stream.Sink$ChainedReference.end(Unknown Source)\r\n\tat java.util.stream.AbstractPipeline.copyInto(Unknown Source)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\r\n\tat java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)\r\n\tat java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)\r\n\tat java.util.stream.AbstractPipeline.evaluate(Unknown Source)\r\n\tat java.util.stream.ReferencePipeline.forEach(Unknown Source)\r\n\tat io.dronefleet.mavlink.serialization.payload.reflection.ReflectionPayloadDeserializer.deserialize(ReflectionPayloadDeserializer.java:48)\r\n\tat io.dronefleet.mavlink.MavlinkConnection.next(MavlinkConnection.java:272)\r\n\tat simpleMavlink.Main.main(Main.java:110)\r\n```\r\nThis problem occurs on different message types. \r\nAnother output stream\r\n```\r\nStart\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=Altitude{timeUsec=null, altitudeMonotonic=-49.501213, altitudeAmsl=-49.501213, altitudeLocal=-5.7601304, altitudeRelative=-5.7601304, altitudeTerrain=NaN, bottomClearance=NaN}}\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=ServoOutputRaw{timeUsec=2199857700, port=1, servo1Raw=1500, servo2Raw=1500, servo3Raw=1500, servo4Raw=1500, servo5Raw=0, servo6Raw=0, servo7Raw=0, servo8Raw=0, servo9Raw=0, servo10Raw=0, servo11Raw=0, servo12Raw=0, servo13Raw=0, servo14Raw=0, servo15Raw=0, servo16Raw=0}}\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=VfrHud{airspeed=0.0, groundspeed=0.019179275, heading=287, throttle=0, alt=-49.501213, climb=0.6250572}}\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=AttitudeQuaternion{timeBootMs=6494831, q1=0.8041289, q2=0.048920356, q3=0.05162769, q4=-0.5901849, rollspeed=-1.6618893E-4, pitchspeed=5.9161335E-5, yawspeed=1.5552435E-4}}\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=ActuatorControlTarget{timeUsec=null, groupMlx=0, controls=null}}\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=Heartbeat{type=EnumValue{value=13, entry=MAV_TYPE_HEXAROTOR}, autopilot=EnumValue{value=12, entry=MAV_AUTOPILOT_PX4}, baseMode=EnumValue{value=81, entry=null}, customMode=65536, systemStatus=EnumValue{value=0, entry=MAV_STATE_UNINIT}, mavlinkVersion=3}}\r\nHeartbeat\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=Heartbeat{type=EnumValue{value=13, entry=MAV_TYPE_HEXAROTOR}, autopilot=EnumValue{value=12, entry=MAV_AUTOPILOT_PX4}, baseMode=EnumValue{value=81, entry=null}, customMode=65536, systemStatus=EnumValue{value=0, entry=MAV_STATE_UNINIT}, mavlinkVersion=3}}\r\n\r\n Handshake \r\n \r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=ActuatorControlTarget{timeUsec=null, groupMlx=0, controls=null}}\r\nfromV2\r\nMavlinkPacket constructor\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=AttitudeTarget{timeBootMs=6494920, typeMask=0, q=null, bodyRollRate=-0.11579337, bodyPitchRate=-0.91740125, bodyYawRate=0.0035392735, thrust=0.0}}\r\nfromV2\r\nMavlinkPacket constructor\r\n\r\n\r\nException in thread \"main\" java.lang.ArrayIndexOutOfBoundsException\r\n\tat java.lang.System.arraycopy(Native Method)\r\n\tat io.dronefleet.mavlink.serialization.payload.reflection.ReflectionPayloadDeserializer.lambda$5(ReflectionPayloadDeserializer.java:56)\r\n\tat java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)\r\n\tat java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)\r\n\tat java.util.ArrayList.forEach(Unknown Source)\r\n\tat java.util.stream.SortedOps$RefSortingSink.end(Unknown Source)\r\n\tat java.util.stream.Sink$ChainedReference.end(Unknown Source)\r\n\tat java.util.stream.AbstractPipeline.copyInto(Unknown Source)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\r\n\tat java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)\r\n\tat java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)\r\n\tat java.util.stream.AbstractPipeline.evaluate(Unknown Source)\r\n\tat java.util.stream.ReferencePipeline.forEach(Unknown Source)\r\n\tat io.dronefleet.mavlink.serialization.payload.reflection.ReflectionPayloadDeserializer.deserialize(ReflectionPayloadDeserializer.java:48)\r\n\tat io.dronefleet.mavlink.MavlinkConnection.next(MavlinkConnection.java:272)\r\n\tat simpleMavlink.Main.main(Main.java:110)\r\n```\r\nIn this line \r\n`System.arraycopy(payload, offset, data, 0, length);`\r\n\r\nAfter adding system print\r\n\r\n```\r\nMavlinkMessage{originSystemId=1, originComponentId=1, payload=AttitudeTarget{timeBootMs=7214174, typeMask=0, q=null, bodyRollRate=-0.114282124, bodyPitchRate=-0.912515, bodyYawRate=0.0034739806, thrust=0.0}}\r\nfromV2\r\nMavlinkPacket constructor\r\npayload [B@433c675d\r\noffset 0\r\ndata [B@3f91beef\r\nlength 8\r\npayload [B@433c675d\r\noffset 8\r\ndata [B@1a6c5a9e\r\nlength 4\r\npayload [B@433c675d\r\noffset 12\r\ndata [B@37bba400\r\nlength 4\r\npayload [B@433c675d\r\noffset 16\r\ndata [B@179d3b25\r\nlength 4\r\npayload [B@433c675d\r\noffset 20\r\ndata [B@254989ff\r\nlength 4\r\npayload [B@433c675d\r\noffset 24\r\ndata [B@5d099f62\r\nlength 4\r\npayload [B@433c675d\r\noffset 28\r\ndata [B@37f8bb67\r\nlength 4\r\npayload [B@433c675d\r\noffset 32\r\ndata [B@49c2faae\r\nlength 4\r\npayload [B@433c675d\r\noffset 36\r\ndata [B@20ad9418\r\nlength 4\r\npayload [B@433c675d\r\noffset 40\r\ndata [B@31cefde0\r\nlength 2\r\nException in thread \"main\" java.lang.ArrayIndexOutOfBoundsException\r\n\tat java.lang.System.arraycopy(Native Method)\r\n\tat io.dronefleet.mavlink.serialization.payload.reflection.ReflectionPayloadDeserializer.lambda$5(ReflectionPayloadDeserializer.java:62)\r\n```"},"comment":{"url":"https://api.github.com/repos/dronefleet/mavlink/issues/comments/435038468","html_url":"https://github.com/dronefleet/mavlink/issues/15#issuecomment-435038468","issue_url":"https://api.github.com/repos/dronefleet/mavlink/issues/15","id":435038468,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTAzODQ2OA==","user":{"login":"kgmormylo","id":42807304,"node_id":"MDQ6VXNlcjQyODA3MzA0","avatar_url":"https://avatars2.githubusercontent.com/u/42807304?v=4","gravatar_id":"","url":"https://api.github.com/users/kgmormylo","html_url":"https://github.com/kgmormylo","followers_url":"https://api.github.com/users/kgmormylo/followers","following_url":"https://api.github.com/users/kgmormylo/following{/other_user}","gists_url":"https://api.github.com/users/kgmormylo/gists{/gist_id}","starred_url":"https://api.github.com/users/kgmormylo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgmormylo/subscriptions","organizations_url":"https://api.github.com/users/kgmormylo/orgs","repos_url":"https://api.github.com/users/kgmormylo/repos","events_url":"https://api.github.com/users/kgmormylo/events{/privacy}","received_events_url":"https://api.github.com/users/kgmormylo/received_events","type":"User","site_admin":false},"created_at":"2018-11-01T13:19:45Z","updated_at":"2018-11-01T13:19:45Z","author_association":"NONE","body":"you rigth. ServoOutputRaw is last correct message."}}
{"actor":{"display_login":"kgmormylo"}}