ETHZ-RobotX / SuperMegaBot

Main repository of the SuperMegaBot
20 stars 20 forks source link

tracking_camera_odom global frame not exist! #33

Closed MohamedNagyMostafa closed 1 year ago

MohamedNagyMostafa commented 1 year ago

Hello,

I am following instructions provided in your website: https://ethz-robotx.github.io/SuperMegaBot/core-software/HowToRunSoftware.html under subtitle "Autonomous Navigation in Simulation". I already run both commends (1) "roslaunch smb_gazebo sim.launch launch_gazebo_gui:=true world:=planner_tutorial" (2) "roslaunch smb_navigation navigate2d_ompl.launch sim:=true global_frame:=tracking_camera_odom"

But the "tracking_camera_odom" doesn't show up as an option in the list of the fixed frame in RViz. Moreover, I get the following warning (As the coordinates are not there anyway):

[ WARN] [1688371594.204723331, 3311.995000000]: Timed out waiting for transform from base_link to tracking_camera_odom to become available before running costmap, tf error: canTransform: target_frame tracking_camera_odom does not exist.. canTransform returned after 3311.99 timeout was 0.1.

There is no other warning or error message displayed in the 2nd commend terminal. However, the gazebo terminal (1st commend) shows some errors. (I believe they are not relevant to the problem)

Screenshot from 2023-07-03 12-16-51

Edit, This is the tf graph, the coordinate is not shown!

Screenshot from 2023-07-03 12-34-05

daBaret commented 1 year ago

Hi Mohamed, thanks for reaching out! The tracking camera is disabled by default in the simulation. To launch it please run roslaunch smb_gazebo sim.launch tracking_camera:=true.

Let me know if it works. Have a nice day, Davide

MohamedNagyMostafa commented 1 year ago

Perfect! It is shown now. Thank you.

MohamedNagyMostafa commented 1 year ago

Hello!

Even though the "tracking_camera_odom" frame is available, but it seems something wrong. First of all, the robot model and the map doesn't receive any topics. I did check "add by topic" and there is no map published.

Screenshot from 2023-07-03 13-36-03

In addition, the commend "roslaunch smb_navigation navigate2d_ompl.launch sim:=true global_frame:=tracking_camera_odom" 's terminal shows the following error:

_[ WARN] [1688377015.361505178, 2042.339000000]: Timed out waiting for transform from base_link to tracking_camera_odom to become available before running costmap, tf error: Could not find a connection between 'tracking_camera_odom' and 'baselink' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.1 timeout was 0.1.

This is the tf tree after activating the tracking cam. Screenshot from 2023-07-03 13-37-58

I think all issues related to transforming to the "tracking_camera_odom". The transformation error displays everywhere; RobotModel,LiDAR Raw, ... Based on the tf tree, there is no connection between the two frames.

daBaret commented 1 year ago

What is the output of rostopic list | grep camera? And rosnode list?

MohamedNagyMostafa commented 1 year ago

For rostopic list | grep camera :

_/rgb_camera/camera_info /rgb_camera/image_raw /rgb_camera/image_raw/compressed /rgb_camera/image_raw/compressed/parameter_descriptions /rgb_camera/image_raw/compressed/parameter_updates /rgb_camera/image_raw/compressedDepth /rgb_camera/image_raw/compressedDepth/parameter_descriptions /rgb_camera/image_raw/compressedDepth/parameter_updates /rgb_camera/image_raw/theora /rgb_camera/image_raw/theora/parameter_descriptions /rgb_camera/image_raw/theora/parameter_updates /rgb_camera/parameter_descriptions /rgb_camera/parameter_updates /tracking_camera/odom/sample_

For rosnode list :

_/control/controller_spawner /control/joy_teleop/joy_e_stop_node /control/joy_teleop/joy_node /control/joy_teleop/teleop_twist_joy /control/keyboard_teleop/keyboard_teleop /control/smb_robot_state_publisher /control/twist_mux /gazebo /gazebo_gui /rosout /rviz /tracking_camera_odometry_conversion_

daBaret commented 1 year ago

Do you get any output if you echo /tracking_camera/odom/sample?

MohamedNagyMostafa commented 1 year ago

No, it doesn't publish anything.

daBaret commented 1 year ago

Did you get any error while launching the simulation? I think that the gazebo plugin for the tracking cam didn't launch

MohamedNagyMostafa commented 1 year ago

In fact, it shows some errors while launching ... below are screenshots of all "error + warning" msgs.

Screenshot from 2023-07-03 14-39-21

Screenshot from 2023-07-03 14-41-07

This error below looks related: Screenshot from 2023-07-03 14-41-28

And here, although it is Screenshot from 2023-07-03 14-42-03 not an error, looks like odom is disabled (Don't know if it is related)

Then bunch of these errors, but I think not relevant. Screenshot from 2023-07-03 14-42-24

daBaret commented 1 year ago

Did you run rosdep install --from-paths . --ignore-src --os=ubuntu:focal -r -y in you src folder? Could you run it again? Could you also catkin build smb_opc?

MohamedNagyMostafa commented 1 year ago

Regarding "rosdep install --from-paths . --ignore-src --os=ubuntu:focal -r -y"

Output: #All required rosdeps installed successfully

Regarding: "catkin build smb_opc", it builds successfully.

but when I tried to build everything again catkin build to see if there is something wrong happens, I get the following output:

Screenshot from 2023-07-03 15-01-13

Followed by abandoning for the rest of packages:

Screenshot from 2023-07-03 15-01-33

Screenshot from 2023-07-03 15-01-49

I noticed that if I sourced the new devel/setup.bash, everything runs normally. So, I believe these errors happened during building the docker image so it wasn't obvious.

daBaret commented 1 year ago

Is not necessary to run catkin build, this will always fail. You don't have any hardware related packages on you pc. Just run catkin build smb_gazebo

MohamedNagyMostafa commented 1 year ago

It is working now. I think building both smb_gazebo and smb_opc solves the problem.

daBaret commented 1 year ago

Super, happy to hear that :)