From ef9a8c990df89b4d31cdf7d63b062c2c30f67289 Mon Sep 17 00:00:00 2001 From: Ammar Ajmal Date: Tue, 30 Aug 2022 17:52:33 +0900 Subject: [PATCH 1/3] removed python lint spacing warnings --- src/assignment/turtlesim_motion_pose.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/assignment/turtlesim_motion_pose.py b/src/assignment/turtlesim_motion_pose.py index 0b72b31..8558306 100755 --- a/src/assignment/turtlesim_motion_pose.py +++ b/src/assignment/turtlesim_motion_pose.py @@ -7,10 +7,10 @@ import time from std_srvs.srv import Empty -x=0 -y=0 -z=0 -yaw=0 +x = 0 +y = 0 +z = 0 +yaw = 0 def poseCallback(pose_message): global x From 72006ac8f905d8efba2f6c5b0235d3e6681ce0c8 Mon Sep 17 00:00:00 2001 From: Ammar Ajmal Date: Tue, 30 Aug 2022 17:52:43 +0900 Subject: [PATCH 2/3] removed spacing issues --- src/assignment/turtlesim_motion_pose.py | 73 +++++++++++-------------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/src/assignment/turtlesim_motion_pose.py b/src/assignment/turtlesim_motion_pose.py index 8558306..81f34fa 100755 --- a/src/assignment/turtlesim_motion_pose.py +++ b/src/assignment/turtlesim_motion_pose.py @@ -12,74 +12,65 @@ z = 0 yaw = 0 + def poseCallback(pose_message): global x global y, z, yaw - x= pose_message.x - y= pose_message.y + x = pose_message.x + y = pose_message.y yaw = pose_message.theta - #print "pose callback" - #print ('x = {}'.format(pose_message.x)) #new in python 3 - #print ('y = %f' %pose_message.y) #used in python 2 - #print ('yaw = {}'.format(pose_message.theta)) #new in python 3 + # print "pose callback" + # print ('x = {}'.format(pose_message.x)) #new in python 3 + # print ('y = %f' %pose_message.y) #used in python 2 + # print ('yaw = {}'.format(pose_message.theta)) #new in python 3 def move(speed, distance): - #declare a Twist message to send velocity commands + # declare a Twist message to send velocity commands velocity_message = Twist() - #get current location - x0=x - y0=y - #z0=z; - #yaw0=yaw; - velocity_message.linear.x =speed + # get current location + x0 = x + y0 = y + # z0 = z; + # yaw0 = yaw; + velocity_message.linear.x = speed distance_moved = 0.0 - loop_rate = rospy.Rate(10) # we publish the velocity at 10 Hz (10 times a second) - cmd_vel_topic='/cmd_vel' + loop_rate = rospy.Rate(10) # we publish the velocity at 10 Hz (10 times a second) + cmd_vel_topic = '/cmd_vel' velocity_publisher = rospy.Publisher(cmd_vel_topic, Twist, queue_size=10) - - while True : + while True: rospy.loginfo("Turtlesim moves forwards") velocity_publisher.publish(velocity_message) - loop_rate.sleep() - - #rospy.Duration(1.0) - - distance_moved = distance_moved+abs(0.5 * math.sqrt(((x-x0) ** 2) + ((y-y0) ** 2))) - print distance_moved - if not (distance_moved Date: Mon, 5 Sep 2022 05:28:38 +0900 Subject: [PATCH 3/3] removed catkin DEPEND cmake error --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43a10f8..6e23265 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ catkin_package( INCLUDE_DIRS include LIBRARIES ros_essentials_cpp CATKIN_DEPENDS roscpp rospy std_msgs message_runtime - DEPENDS system_lib + # DEPENDS system_lib ) ###########