std_srvs.srv file not in /var/mail folder

asked 2023-01-31 21:59:56 -0600

Shankar gravatar image

I was going though the video in lecture 7. As per the lecture a python program is to be created in the package. The same program shown in the video is added as per the instructions in the video. The program is given below:

!/usr/bin/env python3

from std_srvs.srv import Empty, EmptyResponse import rospy

def empty_response(req): print(“Just another service”) return EmptyResponse()

if name == “main”: rospy.loginfo(‘Empty service started’) rospy.init_node('empty_server_service’) s = rospy.service(‘print_service’, Empty, empty_response_cb) rospy.spin()

When trying to execute, I get the following errors msi@skylab-msi:~/ros_pkg/src/rbt_pkg/ser_pkg/src$ rosrun ser_pkg from: can’t read /var/mail/std_srvs.srv /home/msi/ros_pkg/src/rbt_pkg/ser_pkg/src/ line 4: import: command not found /home/msi/ros_pkg/src/rbt_pkg/ser_pkg/src/ line 6: syntax error near unexpected token (' /home/msi/ros_pkg/src/rbt_pkg/ser_pkg/src/ line 6: def empty_response(req): ’ msi@skylab-msi:~/ros_pkg/src/rbt_pkg/ser_pkg/src$

I navigated to /var/mail folder. I could not find any .srv file.

How to solve this? Thanks in advance

edit retag flag offensive close merge delete