[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>1.如何新建功能包?
在vscode中,右键src文件夹—最后一个:create catkin package —输入功能包名称----在dependency中输入roscpp
rospy std_msgs
<>2.编写完代码如何跑起来测试?
<>(1)在scripts文件中打开终端,添加可执行文件chmod +x *.py , 之后可以用 ll 命令查看
<>(2)配置CMAKEList.txt
# catkin_install_python(PROGRAMS # scripts/my_python_script # DESTINATION
${CATKIN_PACKAGE_BIN_DESTINATION} # )
把my_python_script换成自己的文件,如plumbing_service.py
<>(3)编译shift+ctrl+B
<>(4)在功能包目录下 source ./devel/setup.bash
<>(5)启动功能包rosrun 功能包名称 程序名
如rosrun plumbing_service_client plumbing_service.py
<>(6)命令(打开一个新终端也要source一下)
检测服务端是否成功 rosservice call 话题名称,
再按一下tab键自动补齐(前面有空格),然后可以自己修改一下数据(注意数据修改时,光标移动到数字上再按delete)后回车
如rosservice call AddInts “num1: 0 num2: 0”
通信机制实操
1.启动乌龟
roscore,
rosrun turtlesim turtlesim_node,
rosrun turtlesim turtlesim_teleop_key