Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For help on ros message #2

Closed
Shame-fight opened this issue Oct 14, 2020 · 6 comments
Closed

For help on ros message #2

Shame-fight opened this issue Oct 14, 2020 · 6 comments
Assignees

Comments

@Shame-fight
Copy link

I am using your code on the robot and it is currently running normally. I have two questions that need your help:

    1. The ros message needs to be sent when the target is detected, instead of sending it all the time.
      My goal is only one class of 'person'. Only when a person is detected, I need to send a message. I only need to publish a simple message like 'stop' to another node to receive it to control the robot's walking. How should I modify Code.
  1. I run on jetson nano, so I tend to use yolov3-ting or yolov4-tiny. Can you add these two models?
    Thank you for any help and look forward to receiving your reply. Thank you.
    @indra4837
@indra4837
Copy link
Owner

    1. The ros message needs to be sent when the target is detected, instead of sending it all the time.
      My goal is only one class of 'person'. Only when a person is detected, I need to send a message. I only need to publish a simple message like 'stop' to another node to receive it to control the robot's walking. How should I modify Code.

You can simply place a wrapper function after running the detect function and only publishing a message if the boxes is not empty. If you need to only publish once, you can store the state and publish messages accordingly.

  1. I run on jetson nano, so I tend to use yolov3-ting or yolov4-tiny. Can you add these two models?

You can rename the model parameter as yolov4-tiny and place the .trt file into the yolo folder. I have tested the code with yolov4-tiny and have successfully used it.

@indra4837 indra4837 self-assigned this Oct 15, 2020
@Shame-fight
Copy link
Author

Thanks for your reply, I have solved this problem. In addition, does your code use python2 or python3? Because I found that install_pycuda.sh is based on python3. But I encountered some problems when using it, and installed pycuda using pip (Based on py2).
@indra4837

@indra4837
Copy link
Owner

Yupp, install_pycuda.sh installation script is based on python3.

By default, ROS Melodic uses python2 and thus, pycuda should be installed using pip. Thanks for pointing that out.

I have not tried using python3 for ROS Melodic but it is possible to do so (there are resources online for this). I believe future ROS distro (ROS Noetic onwards) is using python3.

@Shame-fight
Copy link
Author

You are welcome.. I have a question: Is opencv not needed? Cmakelists.txt in the code needs to specify opencv, but it is not linked to any opencv library. I only found that the display image part of the trt_yolo_v3.py file requires opencv. This Does it mean that I only need to install python-opencv. If you don't need to display images, opencv does not need to be installed. Is my understanding correct?

@indra4837
Copy link
Owner

We still need OpenCV for the cv_bridge function. This is because the code processes images in OpenCV format but the input is ROS Image format. Thus, cv_bridge is required to do the necessary conversion here

@Shame-fight
Copy link
Author

Fine,Thank you for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants