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

ModuleNotFoundError: No module named 'turtlesim.msg'; 'turtlesim' is not a package

asked 2023-06-14 01:15:52 -0500

Vrushabh Jain gravatar image

please Help me solve the error it showing turtlesim.msg not found what

Traceback (most recent call last):
  File "/home/jainvrushab5/fsm_ws/src/my_robot_controller/scripts/Frist_node.py", line 4, in <module>
    from turtlesim.msg import Pose
  File "/home/jainvrushab5/fsm_ws/src/my_robot_controller/scripts/turtlesim.py", line 4, in <module>
    from turtlesim.msg import Pose
ModuleNotFoundError: No module named 'turtlesim.msg'; 'turtlesim' is not a package

    #!/usr/bin/env python3
    import rospy
    from geometry_msgs.msg import Twist
    from turtlesim.msg import Pose
    x=0.0
    y=0.0
    def pose_callback(pose: Pose):
       cmd = Twist()
      if rotation < 0 :
      rotation+=1
        elif rotation >= 2 :
              cmd.linear.x= 0.0
              cmd.angular.z= 0.0
      else:
          cmd.linear.x = 3.0
          cmd.angular.z = 3.0/2.0 
          pub.publish(cmd)
    if __name__== '__main__':
        rospy.init_node("Draw_circle")
        pub=rospy.Publisher("/turtle1/cmd_vel",Twist,queue_size=10)
        sub=rospy.Subscriber("/turtle1/pose",Pose,callback=p

ose_callback)
    rospy.loginfo("Drawing a circle Of Radius of 2 ")

    rospy.spin()
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-15 06:52:38 -0500

Mike Scheutzow gravatar image

You need to install the apt package ros-noetic-turtlesim.

sudo apt-get install ros-noetic-turtlesim
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-06-14 01:15:52 -0500

Seen: 99 times

Last updated: Jun 15 '23