Code Monkey home page Code Monkey logo

ros_detection_framework's Introduction

ROS framework for object detection

This is a ROS workspace demo for object detection.

Installation

ROS Installation

Method 1(Recommend): quick install

# 鱼香 ROS
wget http://fishros.com/install -O fishros && . fishros

Method 2step by step install

# step 1: 添加ros软件源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# step 2: 添加秘钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# step 3:添加完源后记得更新一下
sudo apt update
# step 4: 安装 ros
# 查看自己的 ubuntu 版本,安装与自己ubuntu版本匹配的 ROS 版本
lsb_release -a
# ubuntu 20.04 安装 noetic「完整桌面版安装」
sudo apt install ros-noetic-desktop-full

Dependencies

This package is built and tested on Ubuntu 20.04 LTS and ROS Noetic with Python 3.8.

  • Clone the packages to ROS workspace and install requirement for YOLOv5 submodule:
git clone https://github.com/chelixuan/ros_detection_framework.git
pip install empy==3.3.2
pip install catkin-tools rospkg
  • Build the ROS package: conda envs
cd <ros_workspace>/
which python # 查看当前 python 的地址,例如得到 /home/chelx/.conda/envs/ros/bin/python
catkin_make -DPYTHON_EXECUTABLE=/home/chelx/.conda/envs/ros/bin/python # 使用当前环境的python,编译
# 编译过程中,在工作空间的根目录里会自动产生build和devel两个文件夹及其中的文件
# 使用source命令运行devel中的 setup.bash 脚本文件,使工作空间中的环境变量可以生效
source devel/setup.bash
# 为了确保环境变量已经生效,可以使用如下命令进行检查:
echo $ROS_PACKAGE_PATH
  • Make the Python script executable
cd <ros_workspace>/src/xxx_ros/src
chmod +x detect.py

Basic usage

  • Launch the node:

input_image_topic: rosbag

rosbag play <your-rosbag.bag>
roslaunch xxx_ros xxx.launch

input_image_topic: camera

roslaunch xxx_ros camera.launch
roslaunch xxx_ros xxx.launch
  • visualize outputs:
rosnode list
rosnode info /detect
rviz

rostopic echo /xxx/detections

Reference

ros_detection_framework's People

Contributors

chelixuan avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.