-
Notifications
You must be signed in to change notification settings - Fork 45
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
does dds support vehicles to interaction on different devices? #165
Comments
i write a xml config file,it comes error. |
Hi @CuteSmartTiger, Most of the time, if you have two devices in the same LAN, CycloneDDS "should just work". If your network setup gets more complicated, you can configure network interfaces via the CycloneDDS XML config file, which you mentioned you did. If it is not working, can you share your XML configuration, your network setup and any errors you run into? |
xml as follow
python code as follow from os import environ
environ['CYCLONEDDS_URI'] = '/home/xiaoyao/selfproject/selftool/etc/cyclonedds.xml'
from dataclasses import dataclass
from cyclonedds.domain import DomainParticipant,Domain
from cyclonedds.core import Qos, Policy
from cyclonedds.pub import DataWriter
from cyclonedds.sub import DataReader
from cyclonedds.topic import Topic
from cyclonedds.idl import IdlStruct
from cyclonedds.idl.annotations import key
from time import sleep
import numpy as np
try:
from names import get_full_name
name = get_full_name()
except:
import os
name = f"{os.getpid()}"
@dataclass
class Chatter(IdlStruct, typename="Chatter"):
name: str
key("name")
message: str
count: int
rng = np.random.default_rng()
dp = DomainParticipant()
tp = Topic(dp, "Hello", Chatter, qos=Qos(Policy.Reliability.Reliable(0)))
dw = DataWriter(dp, tp)
dr = DataReader(dp, tp)
count = 0
if __name__ == '__main__':
while True:
sample = Chatter(name=name, message="Hello, World!", count=count)
count = count + 1
print("Writing ", sample)
dw.write(sample)
for sample in dr.take(10):
print("Read ", sample)
sleep(rng.exponential()) |
@CuteSmartTiger what error are you getting? Your config seems valid to me |
I run two different cars on the same device, configured with the same domain, and the batches can send and receive information interactively; however, if the two processes are not on the same device, or on different network segments, what should I do the configuration for interaction, is there an example?
The text was updated successfully, but these errors were encountered: