-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add XC-ESC Technology DroneCAN ESC Support!
- Loading branch information
Showing
23 changed files
with
821 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
ExtLibs/DroneCAN/dsdl/com/xckj/esc/20110.CmdControl.uavcan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
OVERRIDE_SIGNATURE 0x4fdf12a8708a2030 | ||
|
||
uint8 NODECMD_DIS_ALL_UP = 0 | ||
uint8 NODECMD_DIS_UP = 1 | ||
uint8 NODECMD_TRIG_HB = 10 | ||
uint8 NODECMD_EN_ALLUP = 100 | ||
uint8 NODECMD_RST = 0xFE | ||
uint8 NodeCmd | ||
|
||
uint8 CmdNodeId | ||
|
||
uint8 reserved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
OVERRIDE_SIGNATURE 0x4df8b5792b8e676a | ||
|
||
uint8[<=3] payload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
OVERRIDE_SIGNATURE 0xb95f98a2bb955035 | ||
|
||
uint16 rpm | ||
uint16 current | ||
uint16 runstatus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
OVERRIDE_SIGNATURE 0x2c8e7c3aaca9e11e | ||
|
||
uint16 PWM | ||
uint16 voltage | ||
uint8 MOS_T | ||
uint8 CAP_T | ||
uint8 Motor_T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
OVERRIDE_SIGNATURE 0x8dfd4ad6e74b6207 | ||
|
||
uint14[<=4] command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
OVERRIDE_SIGNATURE 0xa28b683d1286d1fc | ||
|
||
uint14[<=4] command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
OVERRIDE_SIGNATURE 0x278afc50d7f6f50d | ||
|
||
uint8 baud | ||
--- | ||
uint8 ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
XC TECHNOLOGY CAN ESC | ||
===================== | ||
|
||
These messages are applicable to the CAN ESCs of Shenzhen XC-ESC Technology Co., Ltd. (http://www.xc-bldc.com/). | ||
|
||
note: | ||
the default CAN baud rate of these Xiongcai Technology ESCs is 500,000, but it can be changed using the "SetBaud" command. | ||
|
||
The default CAN node ID is 0x10, and it can be changed using the "SetID" command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using uint8_t = System.Byte; | ||
using uint16_t = System.UInt16; | ||
using uint32_t = System.UInt32; | ||
using uint64_t = System.UInt64; | ||
|
||
using int8_t = System.SByte; | ||
using int16_t = System.Int16; | ||
using int32_t = System.Int32; | ||
using int64_t = System.Int64; | ||
|
||
using float32 = System.Single; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace DroneCAN | ||
{ | ||
public partial class DroneCAN | ||
{ | ||
public partial class com_xckj_esc_AutoUpMsg1 : IDroneCANSerialize | ||
{ | ||
public const int COM_XCKJ_ESC_AUTOUPMSG1_MAX_PACK_SIZE = 6; | ||
public const ulong COM_XCKJ_ESC_AUTOUPMSG1_DT_SIG = 0xb95f98a2bb955035; | ||
public const int COM_XCKJ_ESC_AUTOUPMSG1_DT_ID = 20130; | ||
|
||
public uint16_t rpm = new uint16_t(); | ||
public uint16_t current = new uint16_t(); | ||
public uint16_t runstatus = new uint16_t(); | ||
|
||
public void encode(dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool fdcan = false) | ||
{ | ||
encode_com_xckj_esc_AutoUpMsg1(this, chunk_cb, ctx, fdcan); | ||
} | ||
|
||
public void decode(CanardRxTransfer transfer, bool fdcan = false) | ||
{ | ||
decode_com_xckj_esc_AutoUpMsg1(transfer, this, fdcan); | ||
} | ||
|
||
public static com_xckj_esc_AutoUpMsg1 ByteArrayToDroneCANMsg(byte[] transfer, int startoffset, bool fdcan = false) | ||
{ | ||
var ans = new com_xckj_esc_AutoUpMsg1(); | ||
ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()), fdcan); | ||
return ans; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using uint8_t = System.Byte; | ||
using uint16_t = System.UInt16; | ||
using uint32_t = System.UInt32; | ||
using uint64_t = System.UInt64; | ||
|
||
using int8_t = System.SByte; | ||
using int16_t = System.Int16; | ||
using int32_t = System.Int32; | ||
using int64_t = System.Int64; | ||
|
||
using float32 = System.Single; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace DroneCAN | ||
{ | ||
public partial class DroneCAN | ||
{ | ||
public partial class com_xckj_esc_AutoUpMsg2 : IDroneCANSerialize | ||
{ | ||
public const int COM_XCKJ_ESC_AUTOUPMSG2_MAX_PACK_SIZE = 7; | ||
public const ulong COM_XCKJ_ESC_AUTOUPMSG2_DT_SIG = 0x2c8e7c3aaca9e11e; | ||
public const int COM_XCKJ_ESC_AUTOUPMSG2_DT_ID = 20131; | ||
|
||
public uint16_t PWM = new uint16_t(); | ||
public uint16_t voltage = new uint16_t(); | ||
public uint8_t MOS_T = new uint8_t(); | ||
public uint8_t CAP_T = new uint8_t(); | ||
public uint8_t Motor_T = new uint8_t(); | ||
|
||
public void encode(dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool fdcan = false) | ||
{ | ||
encode_com_xckj_esc_AutoUpMsg2(this, chunk_cb, ctx, fdcan); | ||
} | ||
|
||
public void decode(CanardRxTransfer transfer, bool fdcan = false) | ||
{ | ||
decode_com_xckj_esc_AutoUpMsg2(transfer, this, fdcan); | ||
} | ||
|
||
public static com_xckj_esc_AutoUpMsg2 ByteArrayToDroneCANMsg(byte[] transfer, int startoffset, bool fdcan = false) | ||
{ | ||
var ans = new com_xckj_esc_AutoUpMsg2(); | ||
ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()), fdcan); | ||
return ans; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using uint8_t = System.Byte; | ||
using uint16_t = System.UInt16; | ||
using uint32_t = System.UInt32; | ||
using uint64_t = System.UInt64; | ||
|
||
using int8_t = System.SByte; | ||
using int16_t = System.Int16; | ||
using int32_t = System.Int32; | ||
using int64_t = System.Int64; | ||
|
||
using float32 = System.Single; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace DroneCAN | ||
{ | ||
public partial class DroneCAN | ||
{ | ||
public partial class com_xckj_esc_CmdControl: IDroneCANSerialize | ||
{ | ||
public const int COM_XCKJ_ESC_CMDCONTROL_MAX_PACK_SIZE = 4; | ||
public const ulong COM_XCKJ_ESC_CMDCONTROL_DT_SIG = 0x4fdf12a8708a2030; | ||
public const int COM_XCKJ_ESC_CMDCONTROL_DT_ID = 20110; | ||
|
||
public const double COM_XCKJ_ESC_CMDCONTROL_NODECMD_DIS_ALL_UP = 0; | ||
public const double COM_XCKJ_ESC_CMDCONTROL_NODECMD_DIS_UP = 1; | ||
public const double COM_XCKJ_ESC_CMDCONTROL_NODECMD_TRIG_HB = 10; | ||
public const double COM_XCKJ_ESC_CMDCONTROL_NODECMD_EN_ALLUP = 100; | ||
public const double COM_XCKJ_ESC_CMDCONTROL_NODECMD_RST = 0xFEU; | ||
|
||
public uint8_t NodeCmd = new uint8_t(); | ||
public uint8_t CmdNodeId = new uint8_t(); | ||
public uint8_t reserved = new uint8_t(); | ||
|
||
public void encode(dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool fdcan = false) | ||
{ | ||
encode_com_xckj_esc_CmdControl(this, chunk_cb, ctx, fdcan); | ||
} | ||
public void decode(CanardRxTransfer transfer, bool fdcan = false) | ||
{ | ||
decode_com_xckj_esc_CmdControl(transfer, this, fdcan); | ||
} | ||
public static com_xckj_esc_CmdControl ByteArrayToDroneCANMsg(byte[] transfer, int startoffset, bool fdcan = false) | ||
{ | ||
var ans = new com_xckj_esc_CmdControl(); | ||
ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()), fdcan); | ||
return ans; | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using uint8_t = System.Byte; | ||
using uint16_t = System.UInt16; | ||
using uint32_t = System.UInt32; | ||
using uint64_t = System.UInt64; | ||
|
||
using int8_t = System.SByte; | ||
using int16_t = System.Int16; | ||
using int32_t = System.Int32; | ||
using int64_t = System.Int64; | ||
|
||
using float32 = System.Single; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace DroneCAN | ||
{ | ||
public partial class DroneCAN | ||
{ | ||
public partial class com_xckj_esc_OperateId : IDroneCANSerialize | ||
{ | ||
public const int COM_XCKJ_ESC_OPERATEID_MAX_PACK_SIZE = 4; | ||
public const ulong COM_XCKJ_ESC_OPERATEID_DT_SIG = 0x4df8b5792b8e676a; | ||
public const int COM_XCKJ_ESC_OPERATEID_DT_ID = 20111; | ||
|
||
public uint8_t payload_len; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint8_t[] payload = Enumerable.Range(1, 3).Select(i => new uint8_t()).ToArray(); | ||
|
||
public void encode(dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool fdcan = false) | ||
{ | ||
encode_com_xckj_esc_OperateId(this, chunk_cb, ctx, fdcan); | ||
} | ||
public void decode(CanardRxTransfer transfer, bool fdcan = false) | ||
{ | ||
decode_com_xckj_esc_OperateId(transfer, this, fdcan); | ||
} | ||
public static com_xckj_esc_OperateId ByteArrayToDroneCANMsg(byte[] transfer, int startoffset, bool fdcan = false) | ||
{ | ||
var ans = new com_xckj_esc_OperateId(); | ||
ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()), fdcan); | ||
return ans; | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using uint8_t = System.Byte; | ||
using uint16_t = System.UInt16; | ||
using uint32_t = System.UInt32; | ||
using uint64_t = System.UInt64; | ||
|
||
using int8_t = System.SByte; | ||
using int16_t = System.Int16; | ||
using int32_t = System.Int32; | ||
using int64_t = System.Int64; | ||
|
||
using float32 = System.Single; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace DroneCAN | ||
{ | ||
public partial class DroneCAN | ||
{ | ||
public partial class com_xckj_esc_ThrotGroup1 : IDroneCANSerialize | ||
{ | ||
public const int COM_XCKJ_ESC_THROTGROUP1_MAX_PACK_SIZE = 7; | ||
public const ulong COM_XCKJ_ESC_THROTGROUP1_DT_SIG = 0x8dfd4ad6e74b6207; | ||
public const int COM_XCKJ_ESC_THROTGROUP1_DT_ID = 20150; | ||
|
||
public uint8_t command_len; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint16_t[] command = Enumerable.Range(1, 4).Select(i => new uint16_t()).ToArray(); | ||
|
||
public void encode(dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool fdcan = false) | ||
{ | ||
encode_com_xckj_esc_ThrotGroup1(this, chunk_cb, ctx, fdcan); | ||
} | ||
public void decode(CanardRxTransfer transfer, bool fdcan = false) | ||
{ | ||
decode_com_xckj_esc_ThrotGroup1(transfer, this, fdcan); | ||
} | ||
public static com_xckj_esc_ThrotGroup1 ByteArrayToDroneCANMsg(byte[] transfer, int startoffset, bool fdcan = false) | ||
{ | ||
var ans = new com_xckj_esc_ThrotGroup1(); | ||
ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()), fdcan); | ||
return ans; | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using uint8_t = System.Byte; | ||
using uint16_t = System.UInt16; | ||
using uint32_t = System.UInt32; | ||
using uint64_t = System.UInt64; | ||
|
||
using int8_t = System.SByte; | ||
using int16_t = System.Int16; | ||
using int32_t = System.Int32; | ||
using int64_t = System.Int64; | ||
|
||
using float32 = System.Single; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace DroneCAN | ||
{ | ||
public partial class DroneCAN | ||
{ | ||
public partial class com_xckj_esc_ThrotGroup2 : IDroneCANSerialize | ||
{ | ||
public const int COM_XCKJ_ESC_THROTGROUP2_MAX_PACK_SIZE = 7; | ||
public const ulong COM_XCKJ_ESC_THROTGROUP2_DT_SIG = 0xa28b683d1286d1fc; | ||
public const int COM_XCKJ_ESC_THROTGROUP2_DT_ID = 20151; | ||
|
||
public uint8_t command_len; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint16_t[] command = Enumerable.Range(1, 4).Select(i => new uint16_t()).ToArray(); | ||
|
||
public void encode(dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool fdcan = false) | ||
{ | ||
encode_com_xckj_esc_ThrotGroup2(this, chunk_cb, ctx, fdcan); | ||
} | ||
public void decode(CanardRxTransfer transfer, bool fdcan = false) | ||
{ | ||
decode_com_xckj_esc_ThrotGroup2(transfer, this, fdcan); | ||
} | ||
public static com_xckj_esc_ThrotGroup2 ByteArrayToDroneCANMsg(byte[] transfer, int startoffset, bool fdcan = false) | ||
{ | ||
var ans = new com_xckj_esc_ThrotGroup2(); | ||
ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()), fdcan); | ||
return ans; | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.