ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Ros2 Attribute Error no attribute kill

asked 2022-10-04 16:44:38 -0500

ajc225 gravatar image

I made a custom service where I use the /kill function from turtlesim but for some reason the package can't find the /kill service at all because when I call service list the option does not appear. I added

from turtlesim.srv import Spawn, Kill, TeleportAbsolute, SetPen
from turtlesim.msg import Pose

to my node file and call the service in the node file like:

self.kill_future = self.kill.call_async(Kill.Request(name="turtle1"))

I also have

find_package(turtlesim REQUIRED)

in my Cmake file and

 <build_depend>turtlesim</build_depend>
 <exec_depend>turtlesim</exec_depend>

in the package.

Am I missing something?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-05 23:01:16 -0500

ajc225 gravatar image

I figured it out. I forgot to add

self.kill = self.create_client(Kill, "kill")

in my node when initializing everything

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-10-04 16:38:02 -0500

Seen: 182 times

Last updated: Oct 05 '22