doosan-robotics / doosan-robot

ROS for Doosan Robot
BSD 3-Clause "New" or "Revised" License
128 stars 64 forks source link

state[MOTION_HOLD] rejected event[eConfigDesiredForce] #201

Open buswayne opened 6 months ago

buswayne commented 6 months ago

Using ROS, I often get this error while the robot is moving fast and I immediately a compliance control task begins. The robot basically remains stuck in the position before the set_desired_force is performed.

Any suggestion?

Thanks

song-ms commented 6 months ago

Hello @buswayne,

For a detailed analysis, would it be possible for you to share the script code used and the error log content that occurred?

Thank you

buswayne commented 5 months ago

It remains stuck on set_desired_force command. We (poorly) "fixed it" with the following piece of code that monitors the log_alarm and if it is of the type 1903 (the one we get when the robot is stuck) resets the compliance control. Of course, this is not good practice and if there is a better way please let me know.

    def check_log_alarm(self, data):
        if (data.data != self.last_alarm) and (data.data == 1903):
            print('Resetting desired force')
            self.end_desired_force(ReleaseForceRequest(0.3))
            self.end_compliance_control(ReleaseComplianceCtrlRequest())
            self.begin_compliance_control(TaskComplianceCtrlRequest([3000.0, 3000.0, 3000.0, 200.0, 200.0, 200.0], 1, 0))
            try:
                self.checkpoint(self.args)
                self.checkpoint = None
                self.args = None
            except:
                pass
        self.last_alarm = data.data

Here instead the function calling the force control

self.move_splinej(posj_list, vel=1, acc=1)

# Controllo di forza
moving_force = 50
threshold_force = 10

# print('Prima di compliance:', self.get_tool_force(GetToolForceRequest()).tool_force[2])
self.begin_compliance_control(TaskComplianceCtrlRequest([3000.0, 3000.0, 3000.0, 200.0, 200.0, 200.0], 1, 0)) # stiffness (idk, default numbers), ref frame (1=tool), transition time

self.checkpoint = self.set_desired_force
self.args = SetDesiredForceRequest([0, 0, -moving_force, 0, 0, 0], [0, 0, 1, 0, 0, 0], 1, 0, 0)
self.set_desired_force(SetDesiredForceRequest([0, 0, -moving_force, 0, 0, 0], [0, 0, 1, 0, 0, 0], 1, 0, 0)) #force, direction, ref frame, transition time, force mode (0=absolute)

a = self.get_tool_force(GetToolForceRequest()).tool_force[2]
while(a <= threshold_force):
    # print(a)
    a = self.get_tool_force(GetToolForceRequest()).tool_force[2]
    #rospy.sleep(0.1)

self.suction_deactivate()
self.end_desired_force(ReleaseForceRequest(0))
self.end_compliance_control(ReleaseComplianceCtrlRequest())

Thanks