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

Remove get_service_instance from ros_loader #647

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

kenji-miyake
Copy link
Contributor

@kenji-miyake kenji-miyake commented Sep 24, 2021

Public Changes

None

Description

Since services can't be instantiated in ROS2, I removed the function.
I've noticed this in #644.

Related: #644

How to test
ROS1

$ echo $ROS_DISTRO
noetic

$ python -c "from std_srvs.srv import Trigger; print(Trigger())"
<std_srvs.srv._Trigger.Trigger object at 0x7f42024894c0>

ROS2

$ echo $ROS_DISTRO
galactic

$ python -c "from std_srvs.srv import Trigger; print(Trigger())"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/ros/galactic/lib/python3.8/site-packages/std_srvs/srv/_trigger.py", line 278, in __init__
    raise NotImplementedError('Service classes can not be instantiated')
NotImplementedError: Service classes can not be instantiated

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Copy link
Member

@amacneil amacneil left a comment

Choose a reason for hiding this comment

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

thanks!

@amacneil amacneil merged commit c75698e into RobotWebTools:ros2 Oct 7, 2021
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.

None yet

2 participants