-
Notifications
You must be signed in to change notification settings - Fork 13
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
Enum generation is not supported correctly #76
Comments
I have added a commit fixing this here: #74 Could you test and confirm that it fixes your issue? |
Does this also fix the issue that defaults aren't used? The generated goemetry_msgs/msg/Quaternion is therefore not normalized and breaks other tooling. You have to manually set the fields to the defaults already specified in the IDL because it's unititialized. See And, compare it to the generated type from MicroXRCEDDSGen: // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*!
* @file Quaternion.h
* This header file contains the declaration of the described types in the IDL file.
*
* This file was generated by the tool microxrceddsgen.
*/
#ifndef _Quaternion_H_
#define _Quaternion_H_
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include <stdbool.h>
typedef struct geometry_msgs_msg_Quaternion
{
double x;
double y;
double z;
double w;
} geometry_msgs_msg_Quaternion;
struct ucdrBuffer;
bool geometry_msgs_msg_Quaternion_serialize_topic(struct ucdrBuffer* writer, const geometry_msgs_msg_Quaternion* topic);
bool geometry_msgs_msg_Quaternion_deserialize_topic(struct ucdrBuffer* reader, geometry_msgs_msg_Quaternion* topic);
uint32_t geometry_msgs_msg_Quaternion_size_of_topic(const geometry_msgs_msg_Quaternion* topic, uint32_t size);
#ifdef __cplusplus
}
#endif
#endif // _Quaternion_H_ |
Since this generator targets C99 code generation, at most we can create a utility that fills the struct members with defaults values. As far as I see it is not possible to have something like inherent initialization in a C struct. |
Hi,
I have enum defined inside module and same enum is used inside a struct.
My IDL file looks like this:
Generated code looks like:
In the above code struct element VariableSpeedSign_element type is generated wrongly. Could you please take a look at it?
Let me know if I am doing anything wrong.
The text was updated successfully, but these errors were encountered: