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

Updated with ros2-control Foxy API #44

Merged
merged 34 commits into from
Feb 3, 2021
Merged

Updated with ros2-control Foxy API #44

merged 34 commits into from
Feb 3, 2021

Conversation

ahcorde
Copy link
Collaborator

@ahcorde ahcorde commented Jan 11, 2021

Updated gazebo_ros2_control with the ros2-control Foxy API

NOTE:

ros-foxy-transmission-interface is still not avaiblable, you should include this dependency in your workspace

Signed-off-by: ahcorde [email protected]

Signed-off-by: ahcorde <[email protected]>
@ahcorde
Copy link
Collaborator Author

ahcorde commented Jan 12, 2021

@bmagyar and @Karsten1987 do you mind to have a look ?

@ahcorde ahcorde mentioned this pull request Jan 12, 2021
Signed-off-by: Karsten Knese <[email protected]>
@MartinPeris
Copy link

The demo for the velocity controller is not working. The position controller demo works properly.

Steps to reproduce this:

  • On a terminal execute: ros2 launch gazebo_ros2_control_demos cart_example_velocity.launch.py
  • On another terminal execute: ros2 run gazebo_ros2_control_demos example_velocity

You will see that the cart is not moving. Digging around a bit, I saw that the node velocity_test_node is publishing to the topic /commands instead of /cart_pole_controller/commands. But even after remapping the topic to the correct one and making sure that the messages are published on the correct topic (ros2 topic echo /cart_pole_controller/commands shows the expected messages), the cart still doesn't move. Am I missing something?

@ahcorde
Copy link
Collaborator Author

ahcorde commented Jan 13, 2021

@MartinPeris thank you for testing. This commit should fix the issue a69ff7c

@MartinPeris
Copy link

Thanks for the quick fix! It works :)

Signed-off-by: ahcorde <[email protected]>
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built transmission_interface from source and was able to run the demos 👍

We should update CI not to build ros2_control from source and use debs instead.

@bmagyar
Copy link
Member

bmagyar commented Jan 21, 2021

I've just released transmission_interface, ros/rosdistro#28054

Copy link
Contributor

@Briancbn Briancbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ahcorde, I was trying out this new version. I was playing around with the control_period some bugs were found.

gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp Outdated Show resolved Hide resolved
gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp Outdated Show resolved Hide resolved
@JaehyunShim
Copy link

@ahcorde it seems the current gazebo_ros2_control does not support multiple ros2_control tags. Only the joints in the first ros2_control tag are detected.

@ahcorde
Copy link
Collaborator Author

ahcorde commented Feb 2, 2021

@JaehyunShim can you try the last commit 794da79?

Signed-off-by: ahcorde <[email protected]>
@v-lopez
Copy link
Contributor

v-lopez commented Feb 2, 2021

I'm going to try this today, but for me #44 (review) is still an issue.

Just wrapping the code that parses the yaml file with:

if (!impl_->param_file_.empty())
{
  // Code that loads params
}

is enough.

Also, last time I tried, I had error parsing complex yaml files like this one. The double arrays were loaded as string arrays.

@v-lopez
Copy link
Contributor

v-lopez commented Feb 2, 2021

I've tested our TIAGo mobile base with diff drive and it worked fine after some fixes to the diff drive controller.

ezgif-2-1b72b1bb33ae

We'll start working on a full TIAGo robot to test JTC and eventually MoveIt!. We're not full time on this, so I expect it to take a few weeks.

Copy link
Collaborator

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The position and velocity demos work for me, but the effort demo is failing to find the cart_pole_controller, and that causes gzserver to crash:

[gzserver-1] [ERROR] [1612310632.481354867] [controller_manager]: Loader for controller 'cart_pole_controller' not found
[gzserver-1] terminate called without an active exception
[gzserver-1] Aborted (core dumped)
[ERROR] [gzserver-1]: process has died [pid 259898, exit code 134, cmd 'gzserver 

Docker/Dockerfile Outdated Show resolved Hide resolved
Docker/Dockerfile Outdated Show resolved Hide resolved
@JaehyunShim
Copy link

JaehyunShim commented Feb 3, 2021

@ahcorde

  1. Is there anything that can be done for consistency in the controller.yaml file format for real physical robots and simulated robots?
  2. Controllers are spawned in urdf files now but can you make gazebo_ros2_control an executable so you can run it in a launch file as you could in ROS1?

@JaehyunShim
Copy link

JaehyunShim commented Feb 3, 2021

@JaehyunShim can you try the last commit 794da79?

It works. Thanks!

@JaehyunShim
Copy link

There are some additional strange behavior on my side, compared to master branch (with ros2_control and controllers set to respective version). The joints are not able to maintain at a non-zero certain position. I am using joint_state_controller and joint_trajectory_controller. the hardware interface is hardware_interface/PositionJointInterface.

I have attached the video here (old )(new) Both models and controller parameters are exactly the same.

I have also checked that the command that goes in SetPosition() inside write() is the correct value, however the state is not able to maintain the position. It seems to me it's how the communication between ros2_control and gazebo triggering this error.

Update: links was wrong updated

I am encountering the same problem actually. How did you fix it?

@Briancbn
Copy link
Contributor

Briancbn commented Feb 3, 2021

I am encountering the same problem actually. How did you fix it?

@JaehyunShim Here is my comments #44 (comment). There are several ways to workaround it. Currently, I created an additional gazebo plugin to help calling SetParam("fmax", 0, <joint-force-limit>) inside the Load() function, so that when joint_limit_interface is ready, I can simply remove my own plugin. You can also modify the gazebo_ros2_control to add in your own fix.

* joint_limit_interface is unavailable. See this for more details [ros-controls/ros2_control#279](https://github.com/ros-controls/ros2_control/issues/279)

@ahcorde Should there be a notice in the doc on the problem that the missingjoint_limit_interface may cause if you would like to make use of the PositionInterface, mainly due to fmax is unset? or maybe we can follow up in an issue once this PR is merged?

@v-lopez
Copy link
Contributor

v-lopez commented Feb 3, 2021

@JaehyunShim

1. Is there anything that can be done for consistency in the controller.yaml file format for [real physical robots](https://github.com/ros-controls/ros2_control_demos/blob/master/ros2_control_demo_robot/controllers/rrbot_forward_controller_position.yaml) and [simulated](https://github.com/ros-simulation/gazebo_ros2_control/blob/master/gazebo_ros2_control_demos/config/cartpole_controller.yaml) robots?

2. Controllers are spawned in [urdf files](https://github.com/ros-simulation/gazebo_ros2_control/blob/master/gazebo_ros2_control_demos/urdf/test_cart_position.xacro.urdf#L62) now but can you make gazebo_ros2_control an executable so you can run it in a launch file as you could in [ROS1](https://github.com/ros-industrial/universal_robot/blob/kinetic-devel/ur_gazebo/launch/ur10.launch#L26)?

Regarding this, we're not providing any ROS2 control params through the URDF, and instead use ros-controls/ros2_control#310 to load them once gazebo and the controller manager in it are running. Here you can see the controller params yaml file

I've got a launch file ready but not pushed, hopefully I can push it tonight.

Signed-off-by: ahcorde <[email protected]>
@ahcorde
Copy link
Collaborator Author

ahcorde commented Feb 3, 2021

@JaehyunShim and @v-lopez I unified the yaml file. Can you try it ?

@ahcorde
Copy link
Collaborator Author

ahcorde commented Feb 3, 2021

@chapulina, I was able to reproduce the issue in the docker container. The available classes are:

[gzserver-1] [ERROR] [1612347697.537043257] [controller_manager]: available classes:
[gzserver-1] [ERROR] [1612347697.537051929] [controller_manager]: controller_manager/test_controller
[gzserver-1] [ERROR] [1612347697.537056274] [controller_manager]: forward_command_controller/ForwardCommandController
[gzserver-1] [ERROR] [1612347697.537060021] [controller_manager]: joint_state_controller/JointStateController
[gzserver-1] [ERROR] [1612347697.537063475] [controller_manager]: joint_trajectory_controller/JointTrajectoryController
[gzserver-1] [ERROR] [1612347697.537067085] [controller_manager]: velocity_controllers/JointGroupVelocityController
[gzserver-1] [ERROR] [1612347697.537071095] [controller_manager]: Loader for controller 'effort_controllers' not found

I can see that the package effort_controllers was released but it seems that it not still synchronized.

@JaehyunShim
Copy link

@v-lopez I think @ahcorde made modifications on corresponding lines in the last commit for the first point.

What I mean by the following

  1. Controllers are spawned in urdf files now but can you make gazebo_ros2_control an executable so you can run it in a launch file as you could in ROS1?

is it is not really intuitive you set which controller you are going to use for your robot in a urdf file. You will have to recompile your package every time you switch to different controllers (or you can compile with the symlink option but still does not look that intuitive). Why does gazebo_ros2_control take this method rather than link?
,.

@ahcorde ahcorde requested a review from chapulina February 3, 2021 15:01
Copy link
Collaborator

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the demos work well for me. The code also looks reasonable to me, although I'm not very familiar with the recent developments on ros2_control.

I suggest we get this in to fix the master branch and make a first release. We can open tickets for all outstanding issues to be addressed in follow-up PRs. Otherwise we're going to feature-creep this pull request.

gazebo_ros2_control_demos/package.xml Show resolved Hide resolved
@JaehyunShim
Copy link

@Briancbn I still do not understand why I need to additionally add it to my code to make it work whereas the example provided in the gazebo_ros2_control_demos (which uses the same gazebo_ros2_control::GazeboSystem) already works without it.

@Briancbn
Copy link
Contributor

Briancbn commented Feb 5, 2021

@JaehyunShim I only find out through experiment. I don't know what is causing this, and why the rrbot is working. Maybe @ahcorde or @chapulina could explain this?

@ahcorde
Copy link
Collaborator Author

ahcorde commented Feb 5, 2021

@JaehyunShim or @Briancbn can you open an issue ?

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

Successfully merging this pull request may close these issues.

10 participants