Reputation: 27
I have been trying to set up a custom manipulation station with Kuka IIWA hardware in drake. I got the hardware interface working. When running a joint teleoperation code (adapted from drake/examples/manipulation_station/joint_teleop.py
), the robot jerks violently (all joints tries to move to 0 position) at first and then continues to operate normally. On digging deeper, I found that this is caused by the FirstOrderLowPassFilter
system. While advancing the simulation a tiny bit (simulator.AdvanceTo(1e-6)
) to evaluate the LCM messages to set the initial GUI sliders-filter_initial_output_value
-plant joint positions etc., to match the hardware, the FirstOrderLowPassFilter outputs a momentary value of 0. This sets the IIWA_COMMAND position to zero for an instance and causes a jerk.
How can I avoid this behavior?.
As a workaround, I am subscribing separately to the raw LCM message from the hardware, before initializing the drake systems and sets the filter_initial_output_value
before advancing the simulation. Is this the recommended way?.
Upvotes: 1
Views: 206
Reputation: 2449
I think what you're doing (manually reading the LCM message) is fine.
In the alternative, look how a DiscreteDerivative
offers the suppress_initial_transient = true
option. Perhaps we could add a similar option (via unrestricted update event) to FirstOrderLowPassFilter
so that the initial output value was sampled from the input at t == 0. But the event sequencing of startup may still be difficult. We essentially need to initialize the systems in their dataflow order, including refreshing output ports as events fire, which is not natively supported.
In another alternative, perhaps we could configure the IIWA_COMMAND publisher to not publish at t == 0, instead publishing only t >= 0.005.
Upvotes: 1
Reputation: 5533
FirstOrderLowPassFilter
has a method to set the initial value. https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_first_order_low_pass_filter.html#aaef7539cfbf1acfa0cf487c371bc5360
It is used in the example that you copied from: https://github.com/RobotLocomotion/drake/blob/master/examples/manipulation_station/joint_teleop.py#L146
Upvotes: 0