[{"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}]
此文章默认已经编译好了darknet_ros,仅对参数调整。
1、进入路径catkin_workspace/src/darknet_ros/darknet_ros/yolo_network_config
里面有两个文件夹cfg和weights,我们把之前训练yolov3文件里面的pepper.cfg和pepper_final.weights分别放到各自的文件夹下面。
2、进入路径catkin_workspace/src/darknet_ros/darknet_ros/config:
对于ros.yaml,里面主要定义了订阅的话题和发布的话题,我们可以修改订阅话题,主要是根据你自己发布图像数据的节点的话题名字。这里发布图像数据的话题叫/camera/color/image_raw
subscribers: camera_reading: topic: /camera/color/image_raw queue_size: 1
设置yolo.yaml文件,建议复制一份然后按照自己的需求自定义,我这里叫pepper.yaml,设置如下:
这两个.yaml都是为了ros的参数服务器设置的,可以在程序里通过nh.param()获取这些参数。
3、进入catkin_workspace/src/darknet_ros/darknet_ros/launch
4修改darknet_ros.launch文件中的.yaml文件路径设置,设置为自己的路径
<arg name="network_param_file" default="$(find
darknet_ros)/config/pepper.yaml"/>
4、这里还需要将两个关键的文件移到相应位置,就是.cfg文件和.weight文件。
就成了:roslanch darknet_ros darknet_ros.launch 即可