ros / common_msgs

Commonly used messages in ROS. Includes messages for actions (actionlib_msgs), diagnostics (diagnostic_msgs), geometric primitives (geometry_msgs), robot navigation (nav_msgs), and common sensors (sensor_msgs), such as laser range finders, cameras, point clouds.
http://wiki.ros.org/common_msgs
177 stars 191 forks source link

Default Quaternion is invalid #181

Open Vini-002 opened 2 years ago

Vini-002 commented 2 years ago

I just tried to use the default quaternion - Quaternion() - in a situation where I don't have rotation information and got an error that this quaternion is invalid. The solution was really simple, just added w = 1 as a keyword parameter. I would suggest that to be the default quaternion.

I'm new to open source... but I imagine I should fork, change that and submit a pull request, right?

Vini-002 commented 2 years ago

I've just discovered the code I was looking at was automatically generated by genpy and don't know if it is possible to modify it.

peci1 commented 1 year ago

I don't think such PR would go through. Zero-initialized fields are a pretty standardized thing in ROS messages and nobody should expect anything else. It's the same with colors: if you set just RGB, and forget to set alpha to 1.0, your markers do not show up. The takeaway is - you always need to know and understand the data you are sending.