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

Renamed ign to gz #67

Merged
merged 3 commits into from
Feb 23, 2023
Merged

Renamed ign to gz #67

merged 3 commits into from
Feb 23, 2023

Conversation

ahcorde
Copy link
Collaborator

@ahcorde ahcorde commented Jun 16, 2022

Signed-off-by: ahcorde ahcorde@gmail.com

Renamed ign to gz

@ahcorde ahcorde self-assigned this Jun 16, 2022
README.md Outdated Show resolved Hide resolved
gz_ros2_control/CMakeLists.txt Outdated Show resolved Hide resolved
gz_ros2_control/CMakeLists.txt Outdated Show resolved Hide resolved
gz_ros2_control/CMakeLists.txt Outdated Show resolved Hide resolved
gz_ros2_control/include/gz_ros2_control/gz_system.hpp Outdated Show resolved Hide resolved
@chapulina chapulina added the enhancement New feature or request label Jul 23, 2022
@ahcorde ahcorde changed the base branch from main to master August 27, 2022 09:34
@ahcorde ahcorde requested a review from chapulina August 29, 2022 08:21
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.

Just a few preliminary comments. I suggest setting up CI for all target versions so that it's possible to verify that they all work as intended

gz_ros2_control/CMakeLists.txt Show resolved Hide resolved
gz_ros2_control/CMakeLists.txt Outdated Show resolved Hide resolved

#ifdef GZ_HEADERS
#include <gz/sim/System.hh>
#define GZ_SIM_NAMESPACE gz::sim::
Copy link
Collaborator

Choose a reason for hiding this comment

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

Soon you won't need to define this, because we're backporting the gz::sim namespace to Citadel and Fortress (gazebo-tooling/release-tools#784)

gz_ros2_control/package.xml Outdated Show resolved Hide resolved
gz_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf Outdated Show resolved Hide resolved
@ahcorde
Copy link
Collaborator Author

ahcorde commented Sep 7, 2022

@destogl the gripper mimic example is not working, do you mind to take a look ? Otherwise I will open an issue

@ahcorde
Copy link
Collaborator Author

ahcorde commented Sep 8, 2022

@destogl I think I fixed the issue, do you mind to review this changes 23bf9cd

If the joint reach the limit position it's blocked

@destogl
Copy link
Member

destogl commented Sep 10, 2022

@destogl I think I fixed the issue, do you mind to review this changes 23bf9cd

If the joint reach the limit position it's blocked

This change seems OK to me. @livanov93 is fixing this in #86

@ahcorde
Copy link
Collaborator Author

ahcorde commented Oct 5, 2022

Hi @destogl and @@livanov93,

I was debugging the issue and these are my notes:

I will try to follow up with a fix for dart.

@azeey
Copy link
Contributor

azeey commented Nov 14, 2022

Needs another round of reviews.

@jlamperez
Copy link

Hi, I am trying this PR with humble and garden and I am not able to load the libgz_ros2_control-system.so:

[ign gazebo-1] Library [/workspaces/robotic_arm_ros2_test_ws/install/lib/libgz_ros2_control-system.so] does not export any plugins. The symbol [IgnitionPluginHook] is missing, or it is not externally visible.
[ign gazebo-1] [Err] [SystemLoader.cc:87] Failed to load system plugin [libgz_ros2_control-system.so] : couldn't load library on path [/workspaces/robotic_arm_ros2_test_ws/install/lib/libgz_ros2_control-system.so].

Any idea how to solve this?

@ahcorde
Copy link
Collaborator Author

ahcorde commented Nov 21, 2022

Hey Jorge! @jlamperez

jumm are you trying any of the example worlds?

I think you should update your files, I can see IgnitionPluginHook, do you have a repo that I can check?

@jlamperez
Copy link

@ahcorde you can reproduce it like this:

  • Run this docker in Dockerhub
docker run -it --rm -e DISPLAY=$DISPLAY --user ros:ros --network host -v /tmp/.X11-unix/:/tmp/.X11-unix -v /dev/shm:/dev/shm jlamperez/ros2:humble-cuda-gz-nvidia
  • And based on the README
sudo apt-get update 
source /opt/ros/humble/setup.bash 
mkdir -p ~/ros_ign/src 
cd ~/ros_ign/src/ 
git clone https://github.com/ros-controls/gz_ros2_control 
cd gz_ros2_control 
git checkout remotes/origin/ahcorde/rename/ign_to_gz 
cd .. 
export GZ_VERSION=garden 
rosdep update 
rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y 
cd ..
colcon build 
. install/local_setup.bash 
  • Try the examples:
ros2 launch gz_ros2_control_demos cart_example_position.launch.py

or

ros2 launch gz_ros2_control_demos diff_drive_example.launch.py

I try sending commands but it is not working.

$ ros2 run gz_ros2_control_demos example_position
node created
terminate called after throwing an instance of 'std::runtime_error'
  what():  could not get action server
[ros2run]: Aborted
ros2 run gz_ros2_control_demos example_diff_drive

After a while joint_state_broadcaster and joint_trajectory_controller` die

[ros2-4] Could not contact service /controller_manager/load_controller
[ERROR] [ros2-4]: process has died [pid 2941, exit code 1, cmd 'ros2 control load_controller --set-state active joint_state_broadcaster'].
[INFO] [ros2-5]: process started with pid [3149]
[ros2-5] Could not contact service /controller_manager/load_controller
[ERROR] [ros2-5]: process has died [pid 3149, exit code 1, cmd 'ros2 control load_controller --set-state active joint_trajectory_controller'].

@ahcorde
Copy link
Collaborator Author

ahcorde commented Nov 21, 2022

@jlamperez something is broken in ros_gz, can you compile these packages from source too ? It's working for me, I'm the maintener of ros_gz working on a fix and a release.

Thank you for reporting

@ahcorde
Copy link
Collaborator Author

ahcorde commented Nov 21, 2022

@jlamperez the release should be out today or tomorrow https://discourse.ros.org/t/preparing-for-humble-sync-and-patch-release-2022-11-21/28234/4 with the patches

@jlamperez
Copy link

Yes, now when I compile ros_gz from the source in the humble branch the plugin is loaded and cart_example_position is working but I am seeing a Segmentation fault at the end. Is this correct?

SUCCEEDED result code
async_send_goal
cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
[ERROR] [1669070763.487046078] [trajectory_test_node.rclcpp]: Error in destruction of rcl subscription handle: Failed to delete datareader, at ./src/subscription.cpp:52, at ./src/rcl/subscription.c:183
cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
Fail in delete datareader, at ./src/rmw_service.cpp:103 during '__function__'
[ros2run]: Segmentation fault

The other examples are working well for me.

Thank you for your help!

@ahcorde
Copy link
Collaborator Author

ahcorde commented Nov 22, 2022

@jlamperez maybe the memory/node is not destroyed properly. I will check it

@azeey
Copy link
Contributor

azeey commented Dec 5, 2022

Can you add me as a reviewer?

@ahcorde
Copy link
Collaborator Author

ahcorde commented Dec 6, 2022

@azeey I can assign you to the issue, but I can't add you as a reviewer

Comment on lines 12 to 25
matrix:
version: [fortress]
include:
- docker-image: "ubuntu:22.04"
gz-version: "fortress"
ros-distro: "humble"
- docker-image: "ubuntu:22.04"
gz-version: "fortress"
ros-distro: "rolling"
- docker-image: "ubuntu:22.04"
gz-version: "garden"
ros-distro: "rolling"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be simplified as:

Suggested change
matrix:
version: [fortress]
include:
- docker-image: "ubuntu:22.04"
gz-version: "fortress"
ros-distro: "humble"
- docker-image: "ubuntu:22.04"
gz-version: "fortress"
ros-distro: "rolling"
- docker-image: "ubuntu:22.04"
gz-version: "garden"
ros-distro: "rolling"
matrix:
- docker-image: ["ubuntu:22.04"]
- gz-version: ["fortress", "garden"]
- ros-distro: ["humble", "rolling"]

sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget https://packages.osrfoundation.org/gazebo.key -O - | apt-key add -
if [ "$GZ_VERSION" == "garden" ]; then
GZ_DEPS="libgz-sim7-dev libgz-plugin2-dev"
Copy link
Contributor

Choose a reason for hiding this comment

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

GZ_DEPS is set here, but I don't see where it's being used.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is resolved now, but I don't have permissiont o resolve threads in this repo.

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Git is treating this as a new file. Can you use git mv on the ign version of this file so it's treated as a rename?

gz_ros2_control/src/gz_system.cpp Show resolved Hide resolved
@@ -336,7 +355,6 @@ bool IgnitionSystem::initSim(
this->dataPtr->joints_[j].joint_velocity_cmd = initial_velocity;
}
} else if (joint_info.command_interfaces[i].name == "effort") {
this->dataPtr->joints_[j].joint_control_method |= EFFORT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this removed intentionally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, it's intentionally

Copy link
Member

Choose a reason for hiding this comment

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

Why was this removed? I believe it makes sense, but would like to understand.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because this is not part of the registration

gz_ros2_control/gz_hardware_plugins.xml Show resolved Hide resolved
gz_ros2_control/gz_hardware_plugins.xml Show resolved Hide resolved
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

Made some more suggestions to keep it backward compatible, i.e, you can still use names with ign in them in SDF/URDF/xacro files.

@@ -28,6 +39,12 @@ jobs:
cp -r gz_ros2_control /home/ros2_ws/src/
sh -c 'echo "deb http://packages.ros.org/ros2-testing/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-testing.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
Copy link
Contributor

Choose a reason for hiding this comment

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

We should only enable packages.osrfoundation.org if we're testing Garden. For Fortress, we should use what's available in packages.ros.org.

gz_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf Outdated Show resolved Hide resolved
gz_ros2_control/gz_hardware_plugins.xml Show resolved Hide resolved
gz_ros2_control/package.xml Show resolved Hide resolved
@ahcorde ahcorde requested a review from azeey February 14, 2023 18:59
@ahcorde
Copy link
Collaborator Author

ahcorde commented Feb 14, 2023

@azeey I included some of your suggestions, let me know what do you think.

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

The changes look good! There are still some unresolved comments, so I'll wait
for those before I approve.

sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget https://packages.osrfoundation.org/gazebo.key -O - | apt-key add -
if [ "$GZ_VERSION" == "garden" ]; then
GZ_DEPS="libgz-sim7-dev libgz-plugin2-dev"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is resolved now, but I don't have permissiont o resolve threads in this repo.


#include <hardware_interface/system_interface.hpp>
#include <hardware_interface/types/hardware_interface_type_values.hpp>

#include <rclcpp/rclcpp.hpp>

namespace ign_ros2_control
namespace gz_ros2_control
Copy link
Contributor

Choose a reason for hiding this comment

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

So, I guess the question is do we plan to backport this to older branches? If so, existing code would fail to compile.

@destogl
Copy link
Member

destogl commented Feb 21, 2023

@ahcorde I needed this PR to get compile this package against the last released rolling. Probably we can continue with merging. What do you think? What is needed to finish this?

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Collaborator Author

ahcorde commented Feb 22, 2023

@azeey i used git mv, but I had to rewrite the history.

@destogl I think with the last changes it's ready for a final pass.

@chapulina chapulina removed their request for review February 22, 2023 16:53
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Just a few minor comments.

.github/workflows/ci.yaml Outdated Show resolved Hide resolved

#include <hardware_interface/system_interface.hpp>
#include <hardware_interface/types/hardware_interface_type_values.hpp>

#include <rclcpp/rclcpp.hpp>

namespace ign_ros2_control
namespace gz_ros2_control
Copy link
Member

Choose a reason for hiding this comment

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

since there is a Humble release already, we probably can not backport anymore without breaking API. Rolling can break anyway.

@@ -336,7 +355,6 @@ bool IgnitionSystem::initSim(
this->dataPtr->joints_[j].joint_velocity_cmd = initial_velocity;
}
} else if (joint_info.command_interfaces[i].name == "effort") {
this->dataPtr->joints_[j].joint_control_method |= EFFORT;
Copy link
Member

Choose a reason for hiding this comment

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

Why was this removed? I believe it makes sense, but would like to understand.

Co-authored-by: Dr. Denis <denis@stoglrobotics.de>
@ahcorde ahcorde merged commit ab810e7 into master Feb 23, 2023
@ahcorde ahcorde deleted the ahcorde/rename/ign_to_gz branch February 23, 2023 14:40
@destogl
Copy link
Member

destogl commented Mar 1, 2023

@Mergifyio backport humble

@mergify
Copy link
Contributor

mergify bot commented Mar 1, 2023

backport humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Mar 1, 2023
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit ab810e7)

# Conflicts:
#	.github/workflows/ci.yaml
#	Dockerfile/Dockerfile
#	README.md
#	gz_ros2_control/src/gz_ros2_control_plugin.cpp
#	gz_ros2_control/src/gz_system.cpp
#	gz_ros2_control_demos/config/gripper_controller.yaml
#	gz_ros2_control_demos/examples/example_gripper.cpp
#	gz_ros2_control_demos/launch/cart_example_effort.launch.py
#	gz_ros2_control_demos/launch/cart_example_position.launch.py
#	gz_ros2_control_demos/launch/cart_example_velocity.launch.py
#	gz_ros2_control_demos/launch/diff_drive_example.launch.py
#	gz_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py
#	gz_ros2_control_demos/launch/tricycle_drive_example.launch.py
#	gz_ros2_control_demos/package.xml
#	gz_ros2_control_demos/urdf/test_gripper_mimic_joint.xacro.urdf
#	ign_ros2_control/package.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants