# Affix a joint when in contact with floor (humanoid feet in ROS2)

Hi all. I'm using ROS2 eloquent. How do we affix a joint in space programatically and not in URDF? The joint is not permanently fixed nor do I want to affix to its parent frame but to a point in space relative to the world or odom frame. Basically, how do I tell the TF system that the foot should not move since it is in contact with the floor?

I've added an IMU to my humanoid and used robot_localization node to update the robot state/pose. However the robot IMU response rotates around the torso in RViz because the system knows nothing of the feet being planted on the floor. Since the feet are not fixed to the floor they are free to float around when TF is solved.Since the torso or base_link is the IK root I suppose it chooses this as the rotational root by default.

I believe the robot_state_publisher node is doing the TF based on the code I see there. It seems like there is no way to do this unless I modify robot_state_publisher but I'm thinking someone must have solved this already. Perhaps the footprint frame should be the IK root but this isn't the frame hierarchy that REP-120 recommends. With proper affixing of the feet I can then also compute proper odemetry as the humanoid walks.

Thanks, Colin

edit retag close merge delete

Sort by » oldest newest most voted

So I was able to get this to work but only by changing the frame linkage from world => base_link to world => footprint frame. This is against the recommended linkage in REP-120 but it seems pretty logical to me that the footprint would be the connection to the floor frame not base_link and maybe the REP-120 should be updated? Please correct me if I am misguided.

more

I have a feeling the issue is you are treating "the floor" as something special. It is not. TF is a tree-based system that models/stores transforms. RViz consumes that information, together with your robot model (ie: urdf) to render your robot in the "correct pose". The frame RViz takes as the root frame is something you configure in the general options (this is the Fixed Frame).

But that is really only visualisation. There is no connection to any "ground", nor is "ground" a concept RViz supports or treats special.

So in the end you have a free-floating tree structure with a bunch of meshes attached. It doesn't matter at which frame you start, as it will never connect to anything. The only thing which will change is the way the visualisation looks.

Basically, how do I tell the TF system that the foot should not move since it ...

(more)
( 2020-01-17 11:14:00 -0500 )edit

Correct, I was simplifying things by saying floor. I am in the process of writing a node that detects foot-floor contact and it will also then update the odom frame accordingly as well. I get this part and I already have Orocos lib computing some of my own transforms. The issue is that with world/odom connected to base_link the existing IMU localization rotates the robot around the point of the torso (where base_link is), but it should be at the bottom of the robot wherever the contact of the floor is. You're also right about RViz now looks right only because I have World selected as my Fixed Frame but also the IMU rotation looks correct now because I have temporarily put footprint near the soles of the feet.

I could have my node recompute base_link location based on IMU data but then I feel I am just ...(more)

( 2020-01-17 11:28:12 -0500 )edit