ModuleNotFoundError: No module named 'turtlesim.msg'; 'turtlesim' is not a package
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()