Skip to content

Consider allowing setting of only pose / twist #18

@luca-della-vedova

Description

@luca-della-vedova

Hello!

I would like to use this interface to allow a ROS 2 node to control a robot in simulation by setting its velocity.
I looked at the SetEntityState service, which sets an EntityState and it seems that users can only set both at the same time.
This is a bit tricky because for two reasons:

  • If users want to just do velocity control, it requires them to also read the model's pose at each update cycle and make sure they set it correctly in their message, otherwise they might teleport it to the wrong place.
  • It could make simulation jittery depending on the delay in the communication, for example, let's say I want to move the robot at 1 m/s, I run my velocity control loop at 10 Hz and there is a delay of 0.01s in the communication:
// for t=0
x_actual = 0, requested_x = 0, requested_v = 1.0
// for t=0.1, but simulated_t = 0.11 because of delay in communication
x_actual = 0.11, requested_x = 0.1, requested_v = 1.0
// Model is teleported back by 0.01 m!

Now I understand that the rosidl does not have proper support for optional fields, I think I would recommend two possible solutions:

  • Preferred, add boolean flags to the SetEntityState such as set_pose, set_twist and set_acceleration. Thos tell the service whether the user wants to set each field or whether it should be ignored.
  • Non preferred but possible if we don't want to change the message format, make this implementation dependent, i.e. if users sets a value of NaN for any of those it will be ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions