Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state[MOTION_HOLD] rejected event[eConfigDesiredForce] #201

Open
buswayne opened this issue Apr 22, 2024 · 2 comments
Open

state[MOTION_HOLD] rejected event[eConfigDesiredForce] #201

buswayne opened this issue Apr 22, 2024 · 2 comments

Comments

@buswayne
Copy link

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
Copy link
Contributor

song-ms commented May 10, 2024

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
Copy link
Author

buswayne commented May 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants