Hydroponics Robot Part 4 – Nav2 Goal Accuracy

Welcome back to the Hydroponics Robot project! In this update, I will be discussing some of the challenges I faced while trying to improve the navigation accuracy of my robot.

In the previous update, I mentioned that I was having trouble with the robot getting stuck halfway to its destination. After experimenting with DWB critics, I decided to add multiple waypoints to guide the robot to its target location. This approach involved first getting to the lane and then moving to the specific pot. This solution has worked well for me so far.

During my exploration of the navigation system, I came across some useful references. For example, I found that goal_distance_bias (deprecated, replaced by GoalAlign/scale and GoalDist/scale) and PathDist.scale could be used to adjust the goal distance bias. Additionally, I referred to the following issue on GitHub for further guidance: https://github.com/ros-planning/navigation2/issues/201.

Moving on to getting more precise when reaching a goal, I switched to the precise_goal_checker and significantly reduced the xy_goal_tolerance and yaw_goal_tolerance. However, the robot seemed to be getting stuck when close to the goal. I tried adjusting min_theta and max and in velocities, but the problem persisted. Eventually, I tried removing the RotateToGoal critic, and the issue was instantly resolved.

I guess that the RotateToGoal critic may have been kicking in too early. It would get the angle correct but still be too far away from the goal and unable to get closer. I reverted the velocity parameters and continued to use the commander API to get the bot to go between different locations.

To use the commander API, I had to re-lookup how to get the initial coordinates in a format that worked for a PoseStamped. I found that I could use an initialpose published in rviz2. Running ros2 topic echo /initialpos helped me see the output. I then set up additional posts to the start and end of each column.

Unfortunately, while working on the project, one of the wheel treads came off, and I had to spend some time repairing it. After the repair, I called it a day.

That’s all for this update. Stay tuned for more updates on the Hydroponics Robot project!

Hydroponics Robot Part 3 – Mapping Issues Continued

Hydroponics Robot Part 3 – Mapping Issues Continued

Welcome back to the third part of my series on building a hydroponics robot! In this blog post, I’ll continue discussing the mapping issues I encountered while trying to navigate my robot through narrow passages and plant rows.

Increasing the global costmap

Previously, I tried increasing the global costmap to see if it would improve my robot’s alignment with the rows when it returned. Unfortunately, this didn’t seem to be enough, and the issue persisted. I suspected that the robot’s slight backward angle could be causing the problem, so I decided to try leveling it and see if it would help.

Leveling the robot

I attempted to level the robot to see if it would improve its alignment with the rows when it returned. If leveling the robot works, I may consider getting a gimble for it. However, since I couldn’t find a gimble on short notice, I ended up hot gluing two pringles can lids to the bottom of the bot as a temporary fix.

Recreating the map

Despite my efforts, I still had trouble with alignment and localization drifting. I suspected that I may need to recreate the map since different parts of the robot were having similar issues now.

Re-configuring the initial pose

I also re-configured the initial pose in nav2 so that I don’t have to keep resetting it. This should save me some time and effort during testing and troubleshooting.

Adjusting the parameters

I spent a lot of time messing around with params, but I was still unable to get the robot to navigate around a post without the localization drifting and getting stuck in a recovery loop. One config that did appear to have been missed was that the behavior global_frame was still set to odom instead of map.

Loads of trial and error, but sigma_hit under in nav2 config under amcl appeared to have significantly reduced drifting.

Repairing the tire tread

During my testing, I noticed that the tread of the tire (pvc end cap with rubber glued to it) was lost, so I needed to repair that before continuing.

Trouble navigating through a narrow passage

The robot was still hitting issues exiting a narrow passage but had no problems entering it. It actually seemed to be having trouble going from the middle of the lane to the other lane when the goal was within local costmap vision. I suspect that PathExpiringTimer may have helped with this, but I could not get it to work (probably set it in the wrong place).

I will consider writing a separate blog post about this issue. In the meantime, there’s more information about PathExpiringTimer in the links below:


And that’s it for this blog post! Despite the mapping issues, I’m still making progress with my hydroponics robot, and I’m excited to continue experimenting and tweaking it to get it just right. Stay tuned for more updates in the next part of this series!

Hydroponics Robot Part 2 – Map Resolution

In my work with hydroponics robots, I recently faced challenges related to robot localization and map resolution. After consulting with ChatGPT, I discovered that the lidar and map were not synchronizing properly due to issues with the robot’s odometry.

Fortunately, I was able to resolve the issue and the robot is now able to navigate between two lanes successfully multiple times. However, I still had concerns about the map resolution and decided to test creating the map in a higher resolution.

While this initially proved challenging, I discovered that I had been using the wrong launch file. After fixing this issue, I started with a resolution of 0.01 but found it to be too slow. I then increased the resolution to 0.025 and found that it looked much crisper than the previous 0.05 resolution. Moreover, I did not encounter any issues with the map drifting while generating it, which was a significant improvement from my previous attempts.

However, my virtual machine struggled to process the map with the local cost map and global cost map both set to 25mm. To address this issue, I plan to increase the global cost map to 50mm to see if it helps with processing.

Improving robot localization and map resolution is crucial for the success of hydroponics robots, and I am excited to continue exploring ways to optimize these processes for even better results.

Hydroponics Robot Part 1 – Troubleshooting Robot Localization Issues

I recently faced a challenge when testing the robot’s ability to navigate back and forth between two rows of pipes. Despite several attempts, the robot kept getting stuck, and I suspected that there might be a localization issue causing it to drift from the map.

I turned to ChatGPT for advice, and it suggested calling global_localization occasionally to resync the lidar with the map. However, when I tried to run the command ros2 run amcl global_localization, I received an error message saying that the package amcl could not be found.

I then noticed that my launch file references nav2_amcl, so I asked ChatGPT if there was a difference between the two packages. After some clarification, ChatGPT suggested running ros2 run nav2_amcl global_localization instead. However, this command also returned an error message saying that no executable was found.

Although this seemed to confuse ChatGPT, I did not give up. I tried running ros2 service call /reinitialize_global_localization std_srvs/srv/Empty, which seemed to do something, but the new location was not accurate at all. In fact, each time I re-ran the command, it picked a random location on the map, which was not consistent.

I plan to continue investigating the global_localization command to see if it can help me resync the lidar with the map. I’ll keep you updated on my progress in future blog posts.

In the meantime, if you’ve faced similar localization issues, I’d love to hear from you. Let me know in the comments how you solved the problem, or if you have any other tips or suggestions.