ROS-TCP-Connector icon indicating copy to clipboard operation
ROS-TCP-Connector copied to clipboard

String values in message definitions are not parsed correctly

Open noirb opened this issue 3 years ago • 0 comments

Describe the bug When generating messages from ROS2 message definitions, default values can result in a C# class which cannot be compiled.

To Reproduce Steps to reproduce the behavior:

  1. Generate C# class for a message definition which contains string constants or default values, e.g.:
int32 status
int32 OK = 200
int32 ERROR = 300

string msg
string OK_MSG = "Everything is fine"
string ERROR_MSG = "Something is wrong"
  1. After message generation, the int32 constants will be fine, but the string constants will be formatted incorrectly:
...
public int status;
public int OK = 200;
public int ERROR = 300;

public string msg;
public string OK_MSG = ""Everything is fine"";
public string ERROR_MSG = ""Something is wrong"";
...

Expected behavior All standard features of ROS2 message definitions should be handled.

Environment (please complete the following information, where applicable):

  • Unity Version: Unity 2020.3.8f1
  • Unity machine OS + version: Windows 10
  • ROS machine OS + version: Ubuntu 20.04, ROS Galactic
  • ROS–Unity communication: Docker
  • Branch or version: 0.7.0-preview

noirb avatar Aug 18 '22 11:08 noirb