ros-drivers / vrpn_client_ros

VRPN ROS Client
http://wiki.ros.org/vrpn_client_ros
60 stars 78 forks source link

fix: motive auto generated names are not valid ROS identifiers: "Rigidy Body n" #8

Closed cjue closed 6 years ago

cjue commented 7 years ago

Removes spaces and other invalid characters from rigid body names streamed from Motive.

Old behavior: No TF is published if the rigid body name is invalid.

paulbovbel commented 7 years ago

Thanks for the contribution. It's actually a little trickier than that:

First character is an alpha character ([a-z|A-Z]), tilde (~) or forward slash (/)
Subsequent characters can be alphanumeric ([0-9|a-z|A-Z]), underscores (_), or forward slashes (/)

So the behaviour is different for the first and subsequent characters, as well as underscores and slashes being legal.

cjue commented 7 years ago

I added a commit that applies the name rules for first and subsequent characters.

cjue commented 6 years ago

The last commit fixes a small logic error.

Are you satisfied with this solution? The most pressing use-case in my mind is just the removal of spaces in the default names generated by Motive.

paulbovbel commented 6 years ago

Thanks, I was looking at getting PR builds working before I merged this. LGTM otherwise.