apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Get Position and Driver Input Data

Open BBlumhofer opened this issue 5 years ago • 11 comments

Hi all,

My issue is the following. In the past i worked with Autoware and need to send the information about position, steeringwheel angle, drivepedal and breakpedal via UDP to another computer. With Autoware i wrote a ROS-node doing that for me. In fact that Apollo 6.0 works with Cyber RT i don't know how to do that. Does anyone have an idea how to do that? I work with Apollo 6.0 and lgsvl 2020.06

Regards

BBlumhofer avatar Sep 28 '20 10:09 BBlumhofer

lgsvl do have a bridge, you can ref there forked branch apollo

daohu527 avatar Sep 28 '20 12:09 daohu527

Is there a documentation for the bridge ? After launching the bridge i tried rostopic list bit i always get the error "ERROR: Unable to communicate with master!" in LGSVL I can the Bridge Status is Connected.

BBlumhofer avatar Sep 29 '20 07:09 BBlumhofer

Hi,

I am sorry but I don't see how the links will help me. I know that there is a bridge for the communication between LGSV and apollo and i can configure which data is available in the JSOn file.

What I don't know is how I can access the data. In Autoware I wrote a python listener which subscribed to several ros-topics. The subscriber sends the information via UDP to a different computer. I found this issue: https://github.com/ApolloAuto/apollo/issues/12265 but it's not solved yet...

BBlumhofer avatar Oct 20 '20 06:10 BBlumhofer

cyber

cyber use cyber node to publish and subscribe msg, If you want to work with cyber use python, you can ref to link

Use the talker.py and listener.py example.

daohu527 avatar Oct 20 '20 07:10 daohu527

thanks i will try it !

BBlumhofer avatar Oct 20 '20 10:10 BBlumhofer

So after putting that task to side for a while i tried to use the listener.py example to at first read the values of the apollo/control comand. The following code results in the following error: AttributeError: module 'cyber_py3.cyber' has no attribute 'get_msgtype'. my python scirpt is located at: apollo/cyber/python/cyber_py3/examples

#!/usr/bin/env python3

import sys
sys.path.append("../")
from cyber_py3 import cyber



def callback(data):
    print("Control_Comand:")
    print(data)


def test_listener_class():
    test_node = cyber.Node("listener")
    ControlCommand = cyber.get_msgtype("apollo/control", sleep_s=5)
    test_node.create_reader("apollo/control", ControlCommand, callback)
    test_node.spin()


if __name__ == '__main__':
    cyber.init()
    test_listener_class()
    cyber.shutdown()

BBlumhofer avatar Dec 09 '20 08:12 BBlumhofer

@BBlumi97
did you solve the problem?

Thinsheep avatar Apr 24 '21 17:04 Thinsheep

'cyber_py3.cyber' has no attribute 'get_msgtype'

I found that the get_msgtype is a method of this class Channel Utils (object) but not cyber

daohu527 avatar Apr 25 '21 00:04 daohu527

@BBlumi97 did you solve the problem?

No i didn't i wrote a plugin to read the data from lgsvl instead of apollo

BBlumhofer avatar Apr 26 '21 08:04 BBlumhofer

@BBlumhofer do you have an idea how to print and send the data of objects detected via UDP, please? I am lost

I could manage to run autowarei n Xavier and everything works well I am try to send the data of objects detected via UDP, like x y z and distance please help me

Yousef-Alhattab avatar Sep 16 '22 03:09 Yousef-Alhattab