Obstacle avoidance in PX4

If you don’t get /local_pointcloud then your system is not running correctly. There are a couple of things you should check:

  • If you run rostopic hz on a camera topic: Do you see messages? Is your camera running?
  • If you set the rosconsole level to DEBUG (in the file /avoidance/local_planner/resource/custom_rosconsole.conf) and then run roslaunch, what output do you get?
  • In the launch file: Is the fcu_url set to the correct port for your device?

Hello Baumanta

I am really sorry, I am not able to know that what should I do?

Please help me with the following problems regarding the questions above?

  • I have tested my camera is is working fine, but I am confused on which camera topic I have to do rostopic hz
  • I am attaching my custom_rosconsole.conf file in this there is only one line written, what should I change?
    custom_rosconsole.pdf (29.4 KB)

-I am also attaching my ports information and my launch file , I was not able to figure out that which port is my device connected.
aero_launch_file.pdf (42.6 KB)

ports_info.pdf (39.1 KB)(This port information is from my drone not after ssh connection, but my drone is connected to the intel aero hotspot)

Here is my /etc/mavlink-router/main.conf/ file:
Configuration_file.pdf (17.4 KB)

Sorry for all the trouble.

Thanks

@baumanta

Just now I have noticed that all the pdf files that I uploaded isn’t working, so Ihave changed all the files and now they are opening easily.

So again, I am
attaching the output file of the command roslaunch local_planner local_planner_aero.launch, so that you can check that atleast this command is working fine or not.
Output_File.pdf (74.2 KB)

@baumanta

Hey

I am also working on intel aero drone and want to execute the px4 avoidance library on the intel aero drone.

So I also tried to see whether it is working or not, but the command rostopic hz /local_pointcloud also not giving any value in my case as well.

So can you please tell what might be the problem?

@Utkarsh_Goyal

I already told you what you have to do to debug your system. The problem is not that the script does not work but that you did not set up your system correctly. Please follow the steps I gave you:

  • If you run rostopic hz on a camera topic: Do you see messages? Is your camera running?

Do rostopic list, you’ll see some topics named camera something. Do rostopic hz or echo on them to see whether they are published correctly. Only if you do that you will know if your camera is running correctly.

  • If you set the rosconsole level to DEBUG (in the file /avoidance/local_planner/resource/custom_rosconsole.conf) and then run roslaunch, what output do you get?

I don’t know how to explain that step any better. I think you can figure out that one :wink:

  • In the launch file: Is the fcu_url set to the correct port for your device?

You need to figure out on what device your pixhawk “talks”. You can list all devices with “ls /dev” and then you need to put the right one in the launch file under “fcu_url”. But this is device specific. If you use mavlink router than the ports in the launch file must match the ports specified in the /etc/mavlink-router/main.conf

@baumanta

Hi

I have checked the rostopic hz and rostopic echo on my camera topics they are working fine, I am getting output from these camra topics.

I have set the rosconsole level to DEBUG than I run the command roslaunch local_planner local_planner_aero.launch than I have got the same output as before I am getting.

But I tried that rostopic hz on local pointcloud it is still not working.

Thanks

nice, so now we’ve narrowed down the problem: It lies with near certainty in the communication with the pixhawk. The local planner is not getting the pose information from mavros. You can fix this by putting the correct fcu_url in the launch file

@Utkarsh_Goyal This is the wrong thread for this kind of discussion.

The output you posted does not give any information, we need to see the output of your roslaunch local_planner local_planner_aero.launch with the rosconsole level to debug in order to tell you anything useful

Hi,all

Sorry I was not aware that I should not discuss on this thread.

So can you please tell me which will be better for discussion, as I am new to this forum.

I am attaching my output file of the command roslaunch local_planner local_planner_aero.launch after setting the rosconsole level to debug.
Output.pdf (36.0 KB)

Thanks

I think adding this to your /etc/mavlink-router/main.conf will help:

[UdpEndpoint mavros]
Mode = Normal
Address = 127.0.0.1
Port = 14540

Hello Baumanta

Now I can see the values of the command rostopic local_planner local_planner_aero.launch
The output of the command is:
rostopic hz /local_pointcloud
subscribed to [/local_pointcloud]
average rate: 25.785
min: 0.020s max: 0.072s std dev: 0.01397s window: 24
average rate: 25.513
min: 0.020s max: 0.074s std dev: 0.01469s window: 50
average rate: 25.317
min: 0.020s max: 0.077s std dev: 0.01519s window: 75
average rate: 25.962
min: 0.020s max: 0.077s std dev: 0.01426s window: 103
average rate: 25.954
min: 0.020s max: 0.077s std dev: 0.01426s window: 128
average rate: 25.659
min: 0.020s max: 0.077s std dev: 0.01482s window: 153
average rate: 25.255
min: 0.020s max: 0.078s std dev: 0.01541s window: 176
average rate: 24.860
min: 0.020s max: 0.078s std dev: 0.01585s window: 198
average rate: 24.983
min: 0.020s max: 0.078s std dev: 0.01544s window: 224
average rate: 24.684
min: 0.020s max: 0.078s std dev: 0.01573s window: 246
average rate: 24.721
min: 0.020s max: 0.078s std dev: 0.01565s window: 271
average rate: 24.738
min: 0.020s max: 0.078s std dev: 0.01552s window: 296
average rate: 24.676
min: 0.020s max: 0.078s std dev: 0.01550s window: 320
average rate: 24.622
min: 0.020s max: 0.081s std dev: 0.01570s window: 343
average rate: 24.575
min: 0.020s max: 0.081s std dev: 0.01564s window: 368
average rate: 24.536
min: 0.020s max: 0.081s std dev: 0.01569s window: 391
average rate: 24.573
min: 0.020s max: 0.081s std dev: 0.01570s window: 417

Like this, it means now my system is up and running obstacle avoidance.
But I can’t see any point cloud on my rviz.

Thanks

Can you give us an update on this? Would be highly anticipated since Intel stopped offering the Aero Kit.

Cheers,
Henk

1 Like

hi everyone, How to use sensor LW20 to avoid obstacles on PX4?
This is diagram that to will use

Hi does the default obstacle avoidance mode in ardupilot works well ? Thank you

The px4 avoidance ros node is specific to px4. ArduPilot also has avoidance features, but they’re implemented differently.

1 Like

Does it works well ? And the setup on arducopter is complicated or not ? Thank you

Best to ask about ArduPilot at discuss.ArduPilot.org

Hi ,
I am working on obstacle avoidance with PixHawk and raspberry pi following this link for avoidance GitHub - PX4/PX4-Avoidance: PX4 avoidance ROS node for obstacle detection and avoidance I installed complete method on ubuntu 18.04 with Ros-Melodic but when i run local planner i get some error showing missing parameters basically i’m not able to run the planner . Please help me in this issue .Thank you