ApolloAuto/apollo-platform

关于pb_msgs_example的topic echo的问题

Logital opened this issue · 7 comments

我将pb_msgs_example从apollo-platform中单独提取出来了,并且在apollo-dev docker环境下使用catkin_make单独编译,通过后用rosrun运行pb_talker和pb_listener,通信成功,但我想使用rostopic echo查看的时候却不能查看成功,提示:
/use_sim_time is not set, will not subscribe to simulated time [/clock] topic
ERROR: Cannot load message class for [pb_msgs/Counter]. Are your messages built?
这个是因为什么呢

不好意思,并没有复现你所提到的现象。你可以直接在docker运行rosrun pb_msgs_example pb_talker,然后再rostopic echo /pb_chatter,看看是否还有问题。

@fengqikai1414 我一直是这个现象,您是用bazel编译的吗?我今天研究发现,正常的msg编译之后会在devel/lib/python2.7/dist-packages/pkgname/msg下产生几个python文件,在使用rostopic echo的时候必须存在这几个文件,否则就会报这个错误,而pb_msg的消息编译之后并不会产生这些文件,因此导致了上面的错误,所以我想问一下您,是不是我用的catkin_make的原因?或者是我需要在cmakelist.txt中加一些东西让它能够生成这几个python文件呢?

Not sure if true in this Apollo platform, but if it's in ROS
you need to source the setup.bash, after the build, try this in your workspace:

source devel/setup.bash

then try echo again.

Hi:
It seems that rosdep is not installed in the docker environment. May anyone give some suggestions?



ning@in_dev_docker:/home/tmp/ros$ rostopic echo /counter 
/use_sim_time is not set, will not subscribe to simulated time [/clock] topic
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
ERROR: Cannot load message class for [pb_msgs/Counter]. Are your messages built?

ning@in_dev_docker:/home/tmp/ros$ sudo rosdep init
sudo: rosdep: command not found

ning@in_dev_docker:/home/tmp/ros$ rostopic list
/counter
/pb_chatter
/rosout
/rosout_agg

大家好,这个问题我已经解决了,是因为我没有安装protobuffer的python环境,安装即可

protobuffer的python环境如何安装呢 @Logital

大家好,这个问题我已经解决了,是因为我没有安装protobuffer的python环境

大家好,这个问题我已经解决了,是因为我没有安装protobuffer的python环境,安装即可

大家好,这个问题我已经解决了,是因为我没有安装protobuffer的python环境,安装即可

请问不需要修改其他的设置吗? 比如说dev_start.sh?或者是 export ROS_URI....等?直接在docker外部发送 pb_msgs类型的消息,内部可以实现echo?