@@ -153,38 +153,6 @@ def set_location(self) -> None:
153153 self .mc .focus_servo (i )
154154 time .sleep (self .sleep_time )
155155
156- def trigger_suction_control (self ):
157- """
158- Trigger the suction control API to move the robotic arm.
159- """
160- try :
161- # Send 'state' as a query parameter
162- response = requests .post (f"http://{ self .ip_address } :{ self .ip_port } /control_suction" , params = {"state" : 0 })
163- if response .status_code == 200 :
164- print ("Suction control API triggered successfully:" , response .json ())
165- else :
166- print ("Failed to trigger suction control API:" , response .status_code , response .text )
167- except requests .RequestException as e :
168- print ("Error while triggering suction control API:" , e )
169-
170-
171- def trigger_move (self , angles ):
172- """
173- Trigger the move API to control the robotic arm.
174- """
175- try :
176- # Send 'angles' as JSON in the request body
177- response = requests .post (
178- f"http://{ self .ip_address } :{ self .ip_port } /move" ,
179- json = {"angles" : [angles ]}
180- )
181- if response .status_code == 200 :
182- print ("Suction control API triggered successfully:" , response .json ())
183- else :
184- print ("Failed to trigger suction control API:" , response .status_code , response .text )
185- except requests .RequestException as e :
186- print ("Error while triggering suction control API:" , e )
187-
188156
189157if __name__ == '__main__' :
190158 robot = RoboticArm ()
0 commit comments