anujjain-dev / unitree-go2-ros2

Developing robot description model for Unitree Go2 robot configured with Champ Legged Robots Research Repository
20 stars 0 forks source link

error when run gazebo.launch.py #2

Closed Un1Lee closed 6 days ago

Un1Lee commented 1 week ago

I meet nothing when build. but when I run ros2 lauch go2_config gazebo.launch.py. the gazebo show me the go2 robot, but as the dog lie down on the floor instead your robot standing. and when I use rviz for true. It show there are no tranform from base_footprint to odom. when I see tf and rqt_graph. I think there are some error. for where is no odom in tf. but the topic /odom is existing.

can you give the full rqt_graph\tf picture for me? and anyway, if I run ros2 lauch go2_config bringup.launch.py rviz:=true. it's all right! even I can use keyboard to control it! and it's tf has odom, everything seems ok.

I am ubuntu20 for foxy. Hope your reply!

MertKures commented 6 days ago

I tried the exact same command with the exact same specs (Ubuntu 20.04 and ROS2 Foxy) and the below command resulted in GO2 model laying down on the floor. ros2 lauch go2_config gazebo.launch.py I don't know why it happens but switching to Ubuntu 22.04 and ROS2 Humble seemed to fix it for me.

anujjain-dev commented 6 days ago

Currently the repository is only tested on ros2 humble. Due to which you were able to run the launch in Ubuntu 22 perfectly. All the controllers defined in this model, works fine with ros2 humble. So, one can continue development in Ubuntu 22

The development on Ubuntu 20 (ros2 foxy) is in process due to unavailability of matching ros2 controllers.

anujjain-dev commented 6 days ago

I meet nothing when build. but when I run ros2 lauch go2_config gazebo.launch.py. the gazebo show me the go2 robot, but as the dog lie down on the floor instead your robot standing. and when I use rviz for true. It show there are no tranform from base_footprint to odom. when I see tf and rqt_graph. I think there are some error. for where is no odom in tf. but the topic /odom is existing.

can you give the full rqt_graph\tf picture for me? and anyway, if I run ros2 lauch go2_config bringup.launch.py rviz:=true. it's all right! even I can use keyboard to control it! and it's tf has odom, everything seems ok.

I am ubuntu20 for foxy. Hope your reply!

@Un1Lee , Can you confirm that the ros controllers are loaded properly. For base_footprint to odom transform check the if the nodes are running and there isn't any error logs while launching the file. You can refer odometry and state estimation scripts. Since the same is being able to control in rviz via bringup, the main cause might be due to any plugins not loaded properly in the gazebo. Requesting you to check the logs once. Also, on which Ubuntu/ros version you are trying to run this?

Un1Lee commented 6 days ago

@anujjain-dev , I check it, and found your code can run on humble in ubuntu22. I run the code and error in foxy in ubuntu20. I found champ pull request for foxy, and I change the code. then it still show me:

[joint_group_effort_controller]: using 'effort' command interface alone is not yet implemented yet.

but if I change the .yml:-effort -> -effort -position. then it show 'effort' should be alone. I think this some gap in ros2_control for foxy and humble.

I am not good at ros2_control. I can't found some method to change code about joint_group_effort_controller. if anyone could, I would like to give my code. Now I have no rviz error, only such joint_group_effort_controller error.

anujjain-dev commented 6 days ago

Yes @Un1Lee , I have been trying running it on ros2 foxy with position controller instead of effort as it is not available. But with position controller I'm facing few issues. So, will soon try to resolve and publish the foxy branch. Also, would appreciate if any other developer wants to collaborate. May create a PR.

anujjain-dev commented 6 days ago

Since, this issue is related to ros version specific and hope is resolved. Closing this issue.

Summary: this repo is currently build and tested in ros2 humble (Ubuntu 22). The robot may spawn correctly without any error although it won't standup in gazebo due to unavailability of controllers in ros2 foxy. So, requesting to checkout humble branch and test in Ubuntu 22 - ros2 humble