QVPR / teach-repeat

Visual teach and repeat navigation for ground based mobile robots. Code supporting the IROS2021 paper "Fast and Robust Bio-inspired Teach and Repeat Navigation"
BSD 2-Clause "Simplified" License
40 stars 10 forks source link

image matcher needs miro data? #35

Closed Russ76 closed 2 years ago

Russ76 commented 2 years ago

I'm trying to use the jackal routines and have done the teach. But for the data matching, the error comes up about there not being file or directory: /home/user/miro/data/full

I modified the launch file so that it knows the folder of current data for matching, but image_matcher.py line 17 throws this error

Tobias-Fischer commented 2 years ago

Which launch file did you modify, and how? Which launch file do you execute?

Russ76 commented 2 years ago

uriah@uriah-jetson:~/catkin_ws/src/teach-repeat/launch$ cat data_matching_jackal.launch

~/robot/teach-repeat-data/2022-03-17_06:17:06 ~/robot/teach-repeat-data/2020-09-15_07:00:47-repeat-$(arg odom_corruption_factor)-$(arg repeat_num) false 115 44 1 75 (9,9) 0.1 0.3 1.3 0.2 15 false true true false $(arg odom_corruption_factor) 1.0 false false false true false 3 true 0.5 0.15 0.93 0.35

When I try to run the above, this error comes up: uriah@uriah-jetson:~$ roslaunch teach_repeat data_matching_jackal.launch ... logging to /home/uriah/.ros/log/8ccf407c-a6b6-11ec-8691-4b22728317b1/roslaunch-uriah-jetson-9419.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

RLException: [/home/uriah/catkin_ws/src/teach-repeat/launch/data_matching_jackal.launch] requires the 'odom_corruption_factor' arg to be set The traceback for the exception was written to the log file

Tobias-Fischer commented 2 years ago

Can you try moving this line almost to the top of the file and try again?

Russ76 commented 2 years ago

You say, "this line," and I don't know what line you are referring to!

Tobias-Fischer commented 2 years ago

Apologies, it didn't copy for some reason:

<arg name="odom_corruption_factor" default="1.0" />
Russ76 commented 2 years ago

Yes, that seemed to help. Now this!

uriah@uriah-jetson:~$ roslaunch teach_repeat data_matching_jackal.launch ... logging to /home/uriah/.ros/log/56576f9e-a727-11ec-9d76-9d21e0a58f79/roslaunch-uriah-jetson-8920.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

RLException: [/home/uriah/catkin_ws/src/teach-repeat/launch/data_matching_jackal.launch] requires the 'repeat_num' arg to be set The traceback for the exception was written to the log file

Russ76 commented 2 years ago

What is a proper value for 'repeat_num"?

Tobias-Fischer commented 2 years ago

Any value is good, e.g. "1"

Russ76 commented 2 years ago

Thanks for the answer! Making progress. But the cmd_vel connection may need adjustment. Mine used /jet_drive_controller/cmd_vel How do I remap or get these to connect?

process[odom_corrupter-1]: started with pid [9387] process[image_matcher-2]: started with pid [9388] process[localiser-3]: started with pid [9389] process[goal_repub-4]: started with pid [9390] process[drive_to_pose-5]: started with pid [9391] ERROR: Wrong input topic (or topic field): /goal [goal_repub-4] process has died [pid 9390, exit code 1, cmd /opt/ros/melodic/lib/topic_tools/transform /goal goalPose geometry_msgs/PoseStamped m.pose __name:=goal_repub __log:=/home/uriah/.ros/log/4a831e70-a78b-11ec-8c50-ef8782604021/goal_repub-4.log]. log file: /home/uriah/.ros/log/4a831e70-a78b-11ec-8c50-ef8782604021/goal_repub-4*.log (1.0, 1.0) [INFO] [1647699269.959751]: [Image Matcher] no calibration file for left camera specified. Assuming not calibrated [INFO] [1647699269.969640]: [Image Matcher] no calibration file for right camera specified. Assuming not calibrated loading images... [INFO] [1647699270.038363]: [Image matcher] Using cached preprocessed images. loading complete: 135 images Global localisation - waiting for first odom and image messages

Tobias-Fischer commented 2 years ago

See https://github.com/QVPR/teach-repeat/blob/1926f80ec45ab0d8a781946104e8e26c80d36cb0/launch/data_matching_miro.launch#L57-L58

Russ76 commented 2 years ago

Hey, that was wild! Robot mostly spun in place, did some driving forward, hit the wall twice, and spun some more!

I examined the data files saved by the teach routine. I'm not sure that my pose information is correct in saved odom info. I don't see the numbers increasing much for x or y.

uriah@uriah-jetson:~$ roslaunch teach_repeat data_matching_jackal.launch ... logging to /home/uriah/.ros/log/c4454c32-71d1-11ec-9f75-a1ffe840129e/roslaunch-uriah-jetson-9016.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://uriah-jetson:34021/

SUMMARY

PARAMETERS

NODES / drive_to_pose (teach_repeat/drive_to_pose_controller.py) goal_repub (topic_tools/transform) image_matcher (teach_repeat/image_matcher.py) localiser (teach_repeat/localiser.py) odom_corrupter (teach_repeat/odom_corrupter.py)

ROS_MASTER_URI=http://192.168.1.179:11311

process[odom_corrupter-1]: started with pid [9025] process[image_matcher-2]: started with pid [9026] process[localiser-3]: started with pid [9027] process[goal_repub-4]: started with pid [9028] process[drive_to_pose-5]: started with pid [9029] [INFO] [1647728607.371245]: [Image Matcher] no calibration file for left camera specified. Assuming not calibrated [INFO] [1647728607.381103]: [Image Matcher] no calibration file for right camera specified. Assuming not calibrated loading images... [INFO] [1647728607.447178]: [Image matcher] Using cached preprocessed images. loading complete: 135 images (1.0, 1.0) Global localisation - waiting for first odom and image messages Global localisation - best match at pose 133 [correlation = 0.598821] within goal distance, but theta offset not within tolerance = -19.90 degrees [distance = 0.371] within goal distance, but theta offset not within tolerance = -19.90 degrees [distance = 0.371] within goal distance, but theta offset not within tolerance = -19.90 degrees [distance = 0.371] within goal distance, but theta offset not within tolerance = -19.90 degrees [distance = 0.019] within goal distance, but theta offset not within tolerance = -19.82 degrees [distance = 0.030] within goal distance, but theta offset not within tolerance = -19.74 degrees [distance = 0.047] within goal distance, but theta offset not within tolerance = -19.74 degrees [distance = 0.047] within goal distance, but theta offset not within tolerance = -19.74 degrees [distance = 0.065] within goal distance, but theta offset not within tolerance = -19.65 degrees [distance = 0.087] within goal distance, but theta offset not within tolerance = -19.65 degrees [distance = 0.087] within goal distance, but theta offset not within tolerance = -19.61 degrees [distance = 0.090] within goal distance, but theta offset not within tolerance = -19.57 degrees [distance = 0.103] within goal distance, but theta offset not within tolerance = -19.57 degrees [distance = 0.103] within goal distance, but theta offset not within tolerance = -20.28 degrees [distance = 0.131] within goal distance, but theta offset not within tolerance = -18.78 degrees [distance = 0.144] within goal distance, but theta offset not within tolerance = -18.51 degrees [distance = 0.170] within goal distance, but theta offset not within tolerance = -18.51 degrees [distance = 0.170] within goal distance, but theta offset not within tolerance = -18.49 degrees [distance = 0.195] within goal distance, but theta offset not within tolerance = -18.57 degrees [distance = 0.227] within goal distance, but theta offset not within tolerance = -18.57 degrees [distance = 0.227] within goal distance, but theta offset not within tolerance = -18.90 degrees [distance = 0.260] within goal distance, but theta offset not within tolerance = -18.90 degrees [distance = 0.260] within goal distance, but theta offset not within tolerance = -19.13 degrees [distance = 0.318] within goal distance, but theta offset not within tolerance = -19.22 degrees [distance = 0.350] within goal distance, but theta offset not within tolerance = -19.22 degrees [distance = 0.350] within goal distance, but theta offset not within tolerance = -19.47 degrees [distance = 0.382] ^C[drive_to_pose-5] killing on exit [goal_repub-4] killing on exit [localiser-3] killing on exit [image_matcher-2] killing on exit [odom_corrupter-1] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done uriah@uriah-jetson:~$

Russ76 commented 2 years ago

rod@rod-HP-Pavilion-Laptop-15-eh0xxx:~$ rostopic list -v

Published topics:

Subscribed topics:

Dominic-DallOsto commented 2 years ago

From the logs:

Global localisation - best match at pose 133 [correlation = 0.598821]
within goal distance, but theta offset not within tolerance = -19.90 degrees [distance = 0.371]
...

The system thinks you started the robot at the end of the teach path based on the images. But the robot isn't able to turn to be in the right direction for the goal.

If your teach path did a loop, going through the start location more than once, the global initialisation might think you're starting somewhere along the route instead of at the start. If this is happening you can disable the global initialisation (then you have to start the robot at the start of the route), or change the teach route not to have this overlap if you can.

But like you say, checking the odometry is a good idea. Could you drive a teach route of say 5 metres in a straight line, then check the saved odometry looks correct?

Russ76 commented 2 years ago

Looking at the pose.txt entries, driving 5 meters in a straight line shows x increasing each time and y barely changing. In orientation, x and y don't change, z increases but not over 0.1, and w stays close to 1.0 Is that correct?

Dominic-DallOsto commented 2 years ago

Yes, x is the forwards direction (from where the robot starts), so if you drive forward 5 metres and get approximately x=5, y=0 and the orientation doesn't really change, then it sounds like your odometry is working correctly.

Are you able to repeat a simple route like this? And what kind of robot are you using? You might need to change the controller settings so the robot drives nicely.

Russ76 commented 2 years ago

Well, tried that but robot wouldn't move at all. It's a four wheel, four motor skid-steer robot, powered by Raspberry Pi and the D435 camera is connected to an Nvidia Jetson TX1. It also has an inexpensive 2D Lidar unit but it wasn't on for these tests. I tried the full loop of room again, and it did start the robot moving, but again, spinning or shaking in place, almost like someone shaking their head, "No, I won't do it. I won't do it!" Thanks for the patient help, you guys are great! I may set up a LinoRobot with Ros2 and try to work with that (on chassis and Raspi.) Teach-Repeat is running on the Jetson, so it might bridge between Ros1 and Ros2, and I wouldn't have to change the Jetson at all! Host is an HP Pavillion laptop with Ryzen 7 processor. I love this laptop! Running Ubuntu 20.04. Jetson has Ubuntu 18.04, and Raspi has Mate 20 and Noetic Ros. Cheers!

Dominic-DallOsto commented 2 years ago

Sounds like an issue with the controller speeds then if the robot just won't move. Maybe teleop your robot around and change the speeds to find out what works. Then change the speeds in the launch file below to match.

https://github.com/QVPR/teach-repeat/blob/1926f80ec45ab0d8a781946104e8e26c80d36cb0/launch/data_matching_jackal.launch#L66-L68