Force_mode / freedrive

Hi everyone,
I am testing the usage of force_mode via TCP connection using Python.
As you can see below I am sending this command to the robot with a wrench_task being a zero (1x6) vector. I would expect robot to stay stationary and behave like in a free drive mode.
The robot stays stationary for a few seconds but then very slowly starts changing its position.

Any suggestions on why such behavior takes place?

force_mode(task_frame=[0, 0, 0, 0, 0, 0], selection_vector=[1, 1, 1, 1, 1, 1],
                                wrench=list(wrench_task), f_type=2, limits=[2, 2, 1.5, 1, 1, 1])

Hi @RobotNoob,

Please make sure the payload and center of gravity(CoG) is configured correctly. On the e-Series you should make use of the zero_ftsensor() before enabling force mode.

Ebbe

1 Like

Thank you for your help :slight_smile:

@Ebbe @ajp

I am trying to implement a robot control method that uses force_mode but in real time.
I want to have a loop that calculates desired wrench with a timestep of 0.002 sec (500HZ) and to feed it into a force_mode in real time to change the position of the robot.
Can I use the force_mode command thats already implemented on the robot? or it doesnt allow for real-time update?

Hi @RobotNoob,

Yes, you can use the built in force_mode for that. I have attached a small sample for robot movement in force_mode
admittance_mode.script (949 Bytes) admittance_sample.urp (3.2 KB)

1 Like

Thank you very much, I have implemented something similar i.e. impedance control but via RTDE.
In my example, the robot.set_force_remote is a force_mode implementation but in RTDE.
I am running a while loop and solving the impedance equation which spits out the wrench in the next time step (125hz so dt=0.008)
The issue I have is that once I run the code, the force mode uses only the wrench obtained from the first iteration and is not being updated by the new values of the wrench at the following time steps, therefore robot instead of moving to the desired location, moves like it has only one value of wrench as an input.

Do you have any ideas why that could happen?

Hi everyone,

This is an old topic, however seems to be the best approach to what I want to implement. On my current setup, I am using a UR5e robot which is controlled via ROS2 (Humble distro). I was interested, when there is an action that triggers a specific part of the code, then this part sends the following command via ROS2 urscript_interface topic: force_mode(get_actual_tcp_pose(), [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0], 2, [0.5, 0.5, 0.5, 0.5, 0.5, 5.0])

I know that when I send this command, then the rest of the nodes will get deactivated on robot’s side. Moreover, a requirement is to set the robot on remote control mode. However, whenever I try to send this command via ROS2, even if I simple try to send this command via ros2 topic pub, nothing is happening on the robot’s side. ROS2 says that the command sent succesfuly, but the robot won’t respond. If I run the code on the tablet via Polyscope, then it responds.

To be noted that I am using Polyscope 5.12. ROS2 that is launched thanks to URCaps is using a TCP protocol if I am not mistaken.

If this can not be achieved via ROS2 and we need a TCP connection using Python, then can the robot run URCaps that on the same time can can be cotroled from ROS2 and also have a parallel tcp connection open probably to a different port than the one used from URcaps (50002).

Any thoughts on that ?