- 博客(6)
- 收藏
- 关注
原创 zip函数的用法
下面是python3的解释:class zip(object) | zip(iter1 [,iter2 [...]]) --> zip object | | Return a zip object whose .__next__() method returns a tuple where | the i-th element comes from the i-th i...
2018-06-13 17:11:19
1915
1
原创 ros运行出错:NameError: global name 'SongListResponse' is not defined
1.说明我自己写了个基于service通信的server和client,以下是srv文件: song_list_node/srv路径下的SongList.srvstring album---string[] song_listclient发送一个string类型的专辑名,server以列表形式返回该专辑下的所有歌曲。2.song_list_server.py#!/...
2018-04-19 11:11:04
1370
原创 ros中的service和client
参考:Writing a Simple Service and Client (Python)首先是用到的add_two_ints/srv路径下的AddTwoInts.srv文件:int64 aint64 b---int64 sum # 前面是field type,后面是field nameserver#!/usr/bin/env pythonimport ro...
2018-04-17 22:17:05
1331
原创 ros中的Publisher和Subscriber
topic是ros的通信方式之一,节点(node)之间通过向主题(topic)上发布(publish)和订阅(subscribe)消息(message)来进行消息传递以下是wiki上的示例,可以直接访问:Writing a Simple Publisher and Subscriber 下面上代码首先是用到的std_msgs/msg路径下的String.msg文件中的内容:s...
2018-04-17 21:34:36
2696
原创 reduce函数的用法
首先看reduce函数的官方解释(python2):reduce(...) reduce(function, sequence[, initial]) -> value Apply a function of two arguments cumulatively to the items of a sequence, from left to right,...
2018-04-17 19:43:50
8671
原创 map函数的用法
map函数在python2和python3中稍有不同,python2直接返回一个列表,python3则返回一个map的可迭代对象一、python2的官方解释:map(...) map(function, sequence[, sequence, ...]) -> list Return a list of the results of applying the fu...
2018-04-17 11:30:01
16132
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人