Rover Object Avoidance using ROS for Path Planning


This is a first test of ArduPilot Rover-3.6 using ROS’s base local planner to do path planning around objects.

A rover moving around objects using ROS has been done before but what is special here is the improved integration with ArduPilot and the Ground station. The user can input the target directly into their normal ground station (by right-mouse-button clicking on the GCS map) instead of having to use ROS directly.

What is happening is the target position from the ground station is transmitted to mavros (with this extra change applied) to ROS’s navigation library (running on a TX2 on the vehicle). This library calculates the path around the objects and then sends velocity commands back to the flight controller. The flight controller is running Rover (in Guided mode) which then executes these lower level velocity commands and the vehicle moves to the target.

Instructions for setting up ROS with ArduPilot are here on the developer wiki. The page with specific object avoidance setup is here.

There are a few issues to be solved including figuring out why the Rover is moving so incredibly slowly. I suspect it is a configuration issue on the ROS side but perhaps it is something else.

We also want to get this working for multicopters as well.

Above is a follow-up video showing how ROS’s path planning can also be used from within Auto mode when GUIDED_ENABLED parameters are added to the mission (sorry the clip showing the mission setup was somehow truncated). When these commands are executed Rover continuously sends the target position to ROS and also accepts the low-level velocity commands from ROS just like it did in Guided mode. ArduPilot also checks it’s position and once it gets within WP_RADIUS of the point it moves onto the next command.

A number of issues are clear after doing this test:

  • ROS is constantly re-calculating the path because ArduPilot is sending the position target at 1hz and this causes the rover to get too close to objects. This is why the green path in the rviz view always starts at the vehicle’s current position. In the original Guided test the green line started at the vehicle’s original position. I think we will need a mavros change so the position is only resent to the path planner if the destination has changed
  • When the vehicle reached the destination it did not immediately turn around and travel back to waypoint2. Instead i had to manually set the active waypoint to waypoint2. The reason is because Rover’s WP_RADIUS parameter was only 0.2m while ROS’s path planner’s tolerance was set to 0.5m. This is just a configuration issue so not a big problem.

By the way, the vehicle is an AION Robotics R1 (ArduPilot Edition) with an NVidia TX2 running ROS, Cartographer, mavros, Base Local Planner. The Lidar in an RPLidarA2.

Special thanks to Mario Rodriguez from EAMSLab and Jaime Machuca from AION Robotics for help with the ROS setup.

6 Likes

Thanks for the great work, Randy!

Regarding the moving speed of the rover, have you tried changing the parameters on the ROS side, specifically max_vel_x, accel_lim_x, acc_lim_theta? With $ rosrun rqt_reconfigure rqt_reconfigure you can change them in real time.

How do you think the rover would behave if we have obstacle avoidance running on ROS as well as ArduPilot?
I guess it would be fine if the two complements each other (i.e. ROS for long distance, static objects and path planning while ArduPilot avoids short range, moving obstacles), but there can be cases where they don’t agree and we might end up in a loop.

1 Like

Hi @LuckyBird,

Txs for the suggestions on the ROS parameters. I poked around with those parameters a bit and I think I set max_vel_x to “5.0” (m/s) but it hasn’t helped much. Still, I know very little about ROS so I may have made a mistake. I certainly haven’t tried changing them in real-time. Txs!

ArduPilot Rover has two types of avoidance built-in,“Dodge” and “Simple”. I think Dodge won’t work well with this new method but “Simple” (which simply stops before hitting objects) should work. So ROS can do the high level path-planning and ArduPilot can continue to do the low level ensuring we don’t hit things.

2 Likes

Hi Randy, Do you have example using Intel Realsense camera?

Hi @kktan, not yet but it’s on the to-do list. There’s already some good documentation on the wiki for connecting AP to the Intel Realsense (with ROS or without ROS) so it’s mostly just a matter of me finding the time to recreate the results Thien was having.

Hi @rmackay9. I didn’t find in the doc and github script anything about move_base/goal (http://wiki.ros.org/move_base#Action_Subscribed_Topics). I mean, I don’t see how mavros is passing the goal from ardupilot to move_base.
By the way, is extending this to copter a straightforward process? (just operate on constant altitude)
Are there any known implementations of 3D local planners for ROS? (besides PX4 avoidance lib)
What bothers me is that we are using here very powerful TX2 GPU for simplified one-step 2D model (from the 90s :slight_smile:) .
Thanks in advance,

I also use this vehicle aion robotics R1.

But I am facing this problem, can you help me?:

github issues

Hi @rmackay9 I have the same Arduros R1 rover with me but I am having trouble moving it using ROS without GPS, are you using it in manual mode or GUIDED?

can i ask what is the topic in the mavros will publish the goal_pose when do fly to here with rover

@Mohamad_Abujarad,

I’m afraid that I’m just not familiar enough with ROS to answer this.

I think if you’re starting fresh it would be good to look at using ROS2 / DDS (see wiki here). There are two developers @rhys and @rfriedman who are much more familiar than I am about AP’s integration with ROS2.

@Mohamad_Abujarad - if you are looking to set up a rover for offboard control I’d recommend using ROS 2 / DDS. There is a good write up here using the nav2 stack for a copter: GSoC 2023: GPS-Denied Autonomous Exploration with ROS 2. The approach is also supported in rover.

1 Like