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

rosrun oafd path_following.py error #13

Open
DigitalDungeon01 opened this issue May 27, 2024 · 15 comments
Open

rosrun oafd path_following.py error #13

DigitalDungeon01 opened this issue May 27, 2024 · 15 comments

Comments

@DigitalDungeon01
Copy link

i got a problem with pat_following.py

Traceback (most recent call last):
File "/home/arief/FYPworkspaces/catkin_ws_OAFD/src/OAFD_Monocular/src/simple_tf.py", line 29, in get_transformation
self.transformation = self.tf_buffer.lookup_transform(self.target_frame,
File "/opt/ros/noetic/lib/python3/dist-packages/tf2_ros/buffer.py", line 90, in lookup_transform
return self.lookup_transform_core(target_frame, source_frame, time)
tf2.LookupException: "tello" passed to lookupTransform argument target_frame does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/arief/FYPworkspaces/catkin_ws_OAFD/src/OAFD_Monocular/src/path_following.py", line 78, in
tello_origin = tf_linster.transform_pose(origin)
File "/home/arief/FYPworkspaces/catkin_ws_OAFD/src/OAFD_Monocular/src/simple_tf.py", line 47, in transform_pose
self.get_transformation()
File "/home/arief/FYPworkspaces/catkin_ws_OAFD/src/OAFD_Monocular/src/simple_tf.py", line 33, in get_transformation
rospy.logerr('Unable to find the transformation from %s to %s'
TypeError: not enough arguments for format string

my steps that i produce this error :

  1. Record bag files
  2. Launch Tello_node.py
  3. Stop bag files
    4.Disconnect Tello
  4. Start roslaunch oafd slam.launch
  5. Play bag file
  6. Ctrl+c (stop) after doing orb slam
  7. Connect to tello back.
  8. run rosrun oafd path_following.py
  9. Error
@DigitalDungeon01
Copy link
Author

image
image

@DigitalDungeon01
Copy link
Author

IMG_20240527_164739
And what topic did you select in order to generate like costmap like you did?. Because when i click on select. There is no map option that showed on my selection

@geturin
Copy link
Owner

geturin commented May 27, 2024

The error in path_following.py is due to the lack of a transformation relationship between the map and Tello coordinate. The Tello coordinate system is transformed from the camera coordinate .

<node pkg="tf2_ros" type="static_transform_publisher" name="tellotf" args="0 0 0 0 -0.099 0 0.995 camera tello" />

so the problem should be that ORB_SLAM3 is not properly publishing the coordinate system. You should check the output of ORB_SLAM3

The global map in the video screenshots is generated using the ROS package octomap_server. However, I soon realized that the octomap constructed from sparse feature points was not very useful, so I abandoned it and did not include it in this project.
If you still want to achieve a similar effect, you can install octomap_server and use it with this pointcloud filter code
https://github.com/geturin/kitti/blob/master/src/pclfilter.py

@DigitalDungeon01
Copy link
Author

DigitalDungeon01 commented May 27, 2024

In order to i get more accurate results. I already do calibration on my drone. But do i need to change on the config file for orb_slam _wrapper and also oafd _monocular package ?

I mean for the camera calibration

# Camera Parameters. Adjust them!

https://github.com/geturin/orb_slam3_ros_wrapper/blob/4f1aaffa1c4eae9ad9680047bd867650f673989e/config/TUM1.yaml#L4

@geturin
Copy link
Owner

geturin commented May 28, 2024

You need to modify the parameters in tello.yaml. Additionally, since I hardcoded the parameters into the depth2pcd.py file
those parameters also need to be modified:
https://github.com/geturin/OAFD_Monocular/blob/master/src/depth2pcd.py

@DigitalDungeon01
Copy link
Author

DigitalDungeon01 commented May 28, 2024

The error in path_following.py is due to the lack of a transformation relationship between the map and Tello coordinate. The Tello coordinate system is transformed from the camera coordinate .

<node pkg="tf2_ros" type="static_transform_publisher" name="tellotf" args="0 0 0 0 -0.099 0 0.995 camera tello" />

so the problem should be that ORB_SLAM3 is not properly publishing the coordinate system. You should check the output of ORB_SLAM3

The global map in the video screenshots is generated using the ROS package octomap_server. However, I soon realized that the octomap constructed from sparse feature points was not very useful, so I abandoned it and did not include it in this project. If you still want to achieve a similar effect, you can install octomap_server and use it with this pointcloud filter code https://github.com/geturin/kitti/blob/master/src/pclfilter.py

i still got problem when doing path_following.py, i dont know what wrong with it. so i include a video so make it easy for you to understand the problem
https://youtu.be/vPnhw5vZAx0

@DigitalDungeon01
Copy link
Author

DigitalDungeon01 commented May 29, 2024

And also for the octomap , it says no module named 'pcl'

Is that because any other libraries dependencies that i need to downlad?

@geturin
Copy link
Owner

geturin commented May 29, 2024

"As I mentioned before, the error is due to ORB_SLAM3 not working. In the video, after you stopped the rosbag playback and connected Tello, it was obvious that ORB_SLAM3 did not compute new coordinates. You can try the following:

1.Adjust the timestamps. Rosbag playback uses the timestamps of the original data, which might differ significantly from the timestamps of the drone data, causing ORB_SLAM3 to fail in computation. You can try removing the timestamp assignment in

pubimg.header.stamp = rospy.Time.now()

and change the publish topic to something else, such as '/camera/img_nostamp'. Then write a subscriber to receive data from '/camera/img_nostamp', add the current timestamp, and publish it back to '/camera/img_raw'. This way, both rosbag and the actual drone will publish the current timestamp.

2.At the end of the rosbag recording, cover Tello's camera with your finger, just like I did in the video. This will cause ORB_SLAM3 to enter tracking loss mode, and when new images come in, it will prioritize loop closure detection.

Finally, yes, you need to install PCL if you want to run octomap.py. However, this doesn't seem to be my code; is it kitti/src/pclfilter.py? In ROS, if you want to use octomap, you need octomap_server. Also, there are many solutions for the global map; you can search for other options

@DigitalDungeon01
Copy link
Author

I finally archive my autonomous dji tello drone, thanks to you for you help!. Thank you so much geturin

But i think my drone need to make better calibration because got some problem with the path that i created because originally the path is more longer and far. But the orb slam kinda translate the path shorter than the original world.

I think need to do some more calibration on the camera.

Anyways , thank you geturin

Test flight :
https://youtube.com/shorts/hSWts8rk7o8?si=Q9HHfSRk6wgCWtsi

@DigitalDungeon01
Copy link
Author

arief@DigitalDungeon01:~/FYPworkspaces/catkin_ws_OAFD$ rosrun octomap_server octomap_server_node

[ INFO] [1717559399.607871918]: Publishing latched (single publish will take longer, all topics are prepared)
[ WARN] [1717559399.657465149]: Nothing to publish, octree is empty

got problem when running pclfilter and octomap server, the node already published the topic but the problem is the terminal from octomap_server_node says "Nothing to publish, octree is empty"

does my command for running the octomap_server is incorrect ?

@geturin
Copy link
Owner

geturin commented Jun 5, 2024

I think you didn't set the parameters in the launch file, or you missed some parameters. You can refer to the following:
https://github.com/OctoMap/octomap_mapping/blob/kinetic-devel/octomap_server/launch/octomap_mapping.launch

@DigitalDungeon01
Copy link
Author

DigitalDungeon01 commented Jun 7, 2024

Do i need to change the topic names?
I mean for this part from the launch file for octomap_server :

	<remap from="cloud_in" to="/narrow_stereo/points_filtered2" />

from filter pcl script:
rospy.Publisher('/filterpcl', PointCloud2, queue_size=1).publish(pcldata)

@DigitalDungeon01
Copy link
Author

<node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
	<param name="resolution" value="0.05" />
	
	<!-- fixed map frame (set to 'map' if SLAM or localization running!) -->
	<param name="frame_id" type="string" value="map" />
	
	<!-- maximum range to integrate (speedup!) -->
	<param name="sensor_model/max_range" value="5.0" />
	
	<!-- data source to integrate (PointCloud2) -->
	<remap from="cloud_in" to="/filterpcl" />

</node>
this is my settings

@DigitalDungeon01
Copy link
Author

but it still shows the some problem
[ WARN] [1717899693.013559003]: Nothing to publish, octree is empty

@geturin
Copy link
Owner

geturin commented Jun 9, 2024

I can't see any obvious errors from the configuration information. You can try checking the following:

Ensure that pointcloud2 data is being published on /filterpcl.
Check the tf tree to ensure there is a proper tf2 relationship between map, world, camera, and tello.

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