Skip to content

Commit e75fd02

Browse files
K-Shuffler蓝启琨
andauthored
feat(MyArmM): Add SD card detection interface (#235)
* add MyCobot 280 X5PI API * add MyCobot 280 X5 PI doc * Fix MyCobot 280 X5 Pi doc errors * add MyCobot 280 X5 PI sokcet sever&client * MyCobot 280 X5 PI server compatible with python2 * rename MyCobot280x5pi to MyCobot280RDKX5 * fix MyArmMControl bugs * fix MyArmC bugs * fix myArmM&C demo bug * update M&C demo * fix MyCobot280 rdkx5 bug * fix MyArmM&C bugs * fix bugs * fix bug * fix ThreeHand api bug * Fixed the issue that Pro630 could not read data * fix MyArmM bug * MyArmM&C adds get_joints_coord interface * fix Pro630 bug * fix Pro630 bugs * Fixed the pro630 socket communication bug * Optimize MyCobot280 RDK X5 interface parameter error prompt * Optimized the way MyAGV reads MCU data * feat(myagvpro): add myagvpro api * fix(ConveyorApi):Fix the problem that no data is returned * feat(MyAGVPro): Adapt to Bluetooth and socket TCP communication modes * docs(MyAGVPro): Format the document * docs(MyAGVPro): Documentation to increase use cases * docs(MyAGVPro): rename MyAGVPro_zh.md * docs(MyAGVPro): Update the serial port * fix(MyArmM): Correction of joint limit and motor code value range * feat(MyAGVPro): Add get_emergency_stop_state api * feat(MyAGVPro): Add get_emergency_stop_state api * refactor(MyAGVPro): rename get_emergency_stop_state to get_estop_state * feat(MyAgv): Added setting/reading automatic report status interface * fix(M750):Updated M750 Swing Limit * fix(MyAGVPro): The issue that Bluetooth address matching fails is fixed * feat(myagvpro): add get_robot_status api * feat(demo):Add myAGVPro composite kit handle control case * feat(MercuryX1): Compatible with dock firmware version 1.2 * feat(mercurychassis_api): Dynamically matching instruction length * feat(mercurychassis_api): Optimize voltage reading accuracy * feat(ConveyorApi): Separate the set_motor_speed interface * feat(ConveyorApi): Specify the motor type during initialization * refactor(conveyorApi): add stop interface * feat(conveyor_api): Adapt to Conveyor 1.1 firmware, all interfaces return uniform values * feat(AGVPRO): Adapt to CH340 serial port chip * feat(AGVPRO): Automatically upload the adapter firmware v1.0.10 * feat(AGVPRO): Added the control interface for opening and closing the handle * feat(AGVPRO): Added an interface for reading handle control status * feat(AGVPRO): Bluetooth adapter handle control interface * fix(mercury): Fix the redundant code in the previous commit * fix(Mercury): Resolved server communication issues affecting both arms * fix(MyAGVPro): Fixed the issue that some interfaces did not return * fix(MyAGVPro): Fixed the interface parameter verification error issue * refactor(MyAGVPro): Optimize get_robot_statuts interface return * feat(MyArmM): Add SD card detection interface. --------- Co-authored-by: Mrkun5018 <76215701+Mrkun5018@users.noreply.github.com> Co-authored-by: 蓝启琨 <qikun.lan@elephantrobotics.com>
1 parent 48d57b7 commit e75fd02

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

pymycobot/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,9 @@ class ProtocolCode(object):
517517
SET_JOINT_DISABLE = '*7'
518518
SET_JOINT_ENABLE = '*8'
519519

520+
# MyArm M750
521+
IS_SD_INSERT = 0xC4
522+
520523

521524
class DataProcessor(object):
522525
crc_robot_class = ["Mercury", "MercurySocket", "Pro630", "Pro630Client", "Pro400Client", "Pro400", "MercuryTest", "Pro450Client"]

pymycobot/myarm_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ def _read(self, genre):
7777
timeout = 0.4
7878
elif genre == ProtocolCode.POWER_ON:
7979
timeout = 2
80+
elif genre == ProtocolCode.IS_SD_INSERT:
81+
timeout = 1
8082
else:
8183
timeout = 0.1
8284

@@ -132,7 +134,8 @@ def _mesg(self, genre, *args, **kwargs):
132134
ProtocolCode.POWER_ON,
133135
ProtocolCode.GET_MASTER_PIN_STATUS,
134136
ProtocolCode.GET_ATOM_PIN_STATUS,
135-
ProtocolCode.GET_SERVO_D
137+
ProtocolCode.GET_SERVO_D,
138+
ProtocolCode.IS_SD_INSERT
136139
]
137140

138141
if genre in return_single_genres:

pymycobot/myarmm.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,11 @@ def is_tool_btn_clicked(self):
162162
def clear_recv_queue(self):
163163
"""Clear the queue for receiving commands"""
164164
self._mesg(ProtocolCode.CLEAR_RECV_QUEUE)
165+
166+
def is_sd_insert(self):
167+
"""Check if the SD card is inserted
168+
169+
Returns:
170+
int: 0/1, 1: insert, 0: no insert
171+
"""
172+
return self._mesg(ProtocolCode.IS_SD_INSERT, has_reply=True)

0 commit comments

Comments
 (0)