rosin-project / metacontrol_sim

2 stars 4 forks source link

[NiceToHave] Create a simplified version of the simulation #4

Open ipa-nhg opened 4 years ago

ipa-nhg commented 4 years ago

I tested the simulation and it works, great job @marioney :tada::tada: The only problem I have is that the real time rate of gazebo is super slow (obviously the problem is my laptop, I usually use my workstation but these days I don't have access to it). Is it ok for you if I create a simplified version of the simulation? Probably just remove the controllers of the yumi will be ok.


Short test protocol:

Installation: https://github.com/rosin-project/metacontrol_sim/blob/1adaafb28d5a92acca70e175955c35e1204418f3/README.md#setup-using-wstool

Command: roslaunch metacontrol_sim ridgeback_yumi_world.launch gui:=true

Test: Terminal A:

rostopic pub /ridgeback_velocity_controller/cmd_vel geometry_msgs/Twist "linear:
  x: 0.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 1.0" -r 10

Terminal B: rostopic echo /ridgeback_velocity_controller/odom

The robot didn't move on gazebo but probably it is related to my computer...

marioney commented 4 years ago

. Is it ok for you if I create a simplified version of the simulation?

if you use the command

roslaunch metacontrol_sim ridgeback_world.launch gui:=true

It will launch only the base without the YUMI altogether. So it may be easier for your laptop to handle it.

The robot didn't move on gazebo but probably it is related to my computer...

I've been using the /cmd_vel topic to control the robot, so I didn't realize that somehow the /ridgeback_velocity_controller/cmd_vel is ignored. I'll take a look a it

chcorbato commented 4 years ago

if you use the command

roslaunch metacontrol_sim ridgeback_world.launch gui:=true

It will launch only the base without the YUMI altogether. So it may be easier for your laptop to handle it.

I do not think that is the case (at least it did not work for me that way) Is it s different roslaunch param name @marioney ?

chcorbato commented 4 years ago

I totally support this request to have a very simple simulation that can be run in any laptop. Mine cannot handle this one. Suggestions:

ipa-nhg commented 4 years ago

if you use the command

roslaunch metacontrol_sim ridgeback_world.launch gui:=true

Thanks! This looks much better. But I think there are some issues with the robot controller :arrow_down:

--

I've been using the /cmd_vel topic to control the robot, so I didn't realize that somehow the /ridgeback_velocity_controller/cmd_vel is ignored. I'll take a look a it

I checked the /cmd_vel topic and for me it has an unknown message type. I took a look at the controller implementation and it seems for the base they use their own gazebo plugin ridgeback_ros_force_based_move and they just added a topic_relay to cmd_vel, but the plugin is already not working for me. I added the missed dependency to the ridgeback_gazebo package and installed all the required package from the release version, I tried also with the source version but so far without success.

--

I totally support this request to have a very simple simulation that can be run in any laptop. Mine cannot handle this one. Suggestions:

* select to use simplified models as a param in the launch file
* other robot model
 * Whatever is easier/faster to implement.

I suggest the use of a common gazebo plugin like the differential_drive_controller (I completely ignore the kinematics of the ridgeback, maybe there is a more adequate one ) where we could also ignore the physics and the contacts of the wheels. We mainly need the collision of the base and a reference link (commonly "base_link") to the center of the base. These simulations are not realistic (you are completely ignoring the friction with the ground) but I think for this experiment is completely fine and should work for any laptop and with a very easy installation setup.

marioney commented 4 years ago

I checked the /cmd_vel topic and for me it has an unknown message type

This is strange, because for me it's a Twist message, as any other /cmd_vel, this is the output of

$ rostopic info /cmd_vel 
Type: geometry_msgs/Twist

Publishers: None

Subscribers: 
 * /cmd_vel_relay (http://mario-laptop:44349/)
 * /gazebo (http://mario-laptop:35645/)

they use their own gazebo plugin ridgeback_ros_force_based_move

I think they use this plugin because the base is holonomic, so my guess is that they implemented this for that.

, I tried also with the source version but so far without success.

This plugin is part of the ridgeback_gazebo_plugins, you can install it directly from debs (ros-melodic-ridgeback-gazebo-plugins) but if you want to check the source code, I think this is the official one.

I suggest the use of a common gazebo plugin like the _differential_drivecontroller (I completely ignore the kinematics of the ridgeback, maybe there is a more adequate one )

I can test the differential_drive_controller but I'll need to change the navigation configuration also.

ipa-nhg commented 4 years ago

@marioney thanks for your answer, I am pretty sure I have a problem of missed dependencies. The people usually forget to list in the package.xml all the dependencies related to the gazebo plugins. These types of errors are very hard to be found by the typical CI tests because don't produce compilation failures, even the common rostests don't check them.

I will give a last try to the simulation setup, in case I can't get it working on my laptop can I send you some instructions to execute our extractor script of your machine and send me back the resulted files?

marioney commented 4 years ago

The people usually forget to list in the package.xml all the dependencies related to the gazebo plugins.

Totally agree, it can get really hectic with dependencies versions and so on.

can't get it working on my laptop can I send you some instructions to execute our extractor script of your machine and send me back the resulted files?

No problem with that. I hope you make it work, and of course I'm happy to execute the extractor if you still run into issues, just let me know!

ipa-nhg commented 4 years ago

ok, fixed. We were right, missed dependencies problem. I fixed it by:

sudo apt-get install ros-melodic-ridgeback-*

Thanks a lot! :+1:

chcorbato commented 4 years ago

ok, fixed. We were right, missed dependencies problem. I fixed it by:

sudo apt-get install ros-melodic-ridgeback-*

Thanks a lot!

Added dependency ros-melodic-ridgeback-gazebo in README.md 5f56076