Skip to content
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

Cant Subscribe to custom message from Unity with ROS# #867

Open
KianRK opened this issue Aug 13, 2023 · 0 comments
Open

Cant Subscribe to custom message from Unity with ROS# #867

KianRK opened this issue Aug 13, 2023 · 0 comments
Labels

Comments

@KianRK
Copy link

KianRK commented Aug 13, 2023

Description

  • Library Version: 1.3.1
  • ROS Version: humble
  • Platform / OS: Windows 10 / Ubuntu 22.04

Hi,

I am trying to subscribe to the /audio/audio topic of the audio_common package from inside Unity.

Unity (2020.3.40) is running on Windows 10 and inside a vm I have Ubuntu 22.04 running.

The WebSocket server is running fine and I can even Subscriber to topics and receive them on Unity side.

But when I try to implement the message for /audio/audio on Unity side and then try to subscribe to the topic, I get:

Error [id: /audio/audio:0] subscribe: is not a valid type string.

I can subscribe to the same topic from a built-in subscriber script, so I guess the error is somewhere in the Serialization of my custom Message type.

I tried every possible way of adding the message according to the ros# wiki https://github.com/siemens/ros-sharp/wiki/Dev_NewMessageTypes

Steps To Reproduce
This is how my custom message looks like in C#

`namespace RosSharp.RosBridgeClient.MessageTypes.AudioCommon
{
public class AudioData : Message
{
public const string RosMessageName = "audio_common_msgs/msg/AudioData";

    public byte[] data { get; set; }

    public AudioData()
    {
        this.data = new byte[0];
    }

    public AudioData(byte[] data)
    {
        this.data = data;
    }
}

}`

@KianRK KianRK added the bug label Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant