-
Notifications
You must be signed in to change notification settings - Fork 486
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
Manipulating ContactPlugin Data #310
Comments
Original comment by Benjamin Swilling (Bitbucket: swillb). Here's a print out of some accumulated force data: data generated this way:
prints out this:
Some of that data seems reasonable, some not. Also it seems I'm only getting updates at around ~30Hz (many repeated force values). I'd expect to see forces around (0,0,500) for a 1000N robot just standing there not doing much. |
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters). Regarding the 30 Hz rate, can you check the model sdf to see whether the contact sensor element has an "update_rate" parameter (units are Hz)? This parameter serves to throttle the contact sensor. If it is not set, then the sensor should update with every simulation step. You can also force an update on every time step by calling SetUpdateRate(0) on the contact sensor object. Let me know if this helps. If not, I'll take another look. |
Original comment by Benjamin Swilling (Bitbucket: swillb). The "update_rate" seemed like a likely culprit, but there was no update_rate set in my urdf file. I did try setting the update_rate through the sensor in my code to something reasonably high (I think 1kHz) however that did not change the behavior. It's also worth noting that when I ran my simulation plant at 8kHz this problem went away. |
Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu). The update rate of 30Hz is because sensors are updated in a loop, which each Sensors::run_once calls individual sensor updates serially, where the combined serial update rate is most likely limited to around 30Hz by image sensor updates due to image generation and memcopy from gpu to cpu memory. |
Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu). Also, each contact message contains array of contacts with unique time stamps, so summation needs to sum only the contacts within the same time step. I've created a patch (see gazebo pull request #199) and drcsim pull request #50. Together, they produce more reasonable plots (see attached). |
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
|
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
|
Original report (archived issue) by Anonymous.
The original report had attachments: Screenshot from 2012-12-18 19:03:19.png, Screenshot from 2012-12-18 19:03:41.png, Screenshot from 2012-12-18 19:04:57.png
Situation: Trying to write a plugin to determine exernal contact forces on a link and publish to a ROS msg.
Status: I have a custom SensorPlugin class written which takes the associated Contact sensor and I can access all the contact data from the gazebo msgs::Contacts. I've verified this some simple printfs.
Next Steps: I'd like to accumulate all external forces/torques and publish a single external force wrench in the link coord frame to a ROS msg. Publishing to Ros is fairly straightforward and there are a number of good code examples to go on. My current issue is with manipulating data coming from the sensor.
In my ContactPlugin load fn I grab a ptr to the physics::Link
In my update function I can grab current pose and contact data from sensor as follows:
First question:
What cardinal point on my link does the pose correspond to, i.e. a point of (0,0,0) in the link frame would be where? At the cg or proximal at the output of the parent joint?
Second question:
I could iterate through all contacts accumulating forces in the link frame
However, this seems like something that would've already been done by your physics engine and I ought to be able to access the accumulated results. There are some force/torque accessors as members of physics::Link
However, the results always seem to be zeros. Am I on the right track with this, is there an easier way?
Many thanks,
The text was updated successfully, but these errors were encountered: