Professional Documents
Culture Documents
task1(e-yantra cc)
task1(e-yantra cc)
executable.
THE CODE:
#!/usr/bin/env python3
import rclpy
import math
class turtle_move(Node):
def _init_(self):
super()._init_('draw_letter')
self.get_logger().info("drawing_letter started")
self.final_x = 7.54
self.final_y = 5.54
error_dist = (error_x*2+error_y2)*0.5
self.get_logger().info(f"Error in x {error_x} and error in y {error_y}")
dist_const = 0.5
theta_const = 1
self.velocity_cont(linear_vel, angular_vel)
msg = Twist()
msg.linear.x = linear_vel
msg.angular.z = angular_vel
self.my_vel_command.publish(msg)
def main(args=None):
rclpy.init(args=args)
node = turtle_move()
rclpy.spin(node)
node.destroy_node()
rclpy.shutdown()
if _name_ == '_main_':
main()
Combinations of coordinates and theta constant used :
*ROS2 is a new version of ROS that was developed from scratch to address some of the limitations
and challenges of ROS1.
--ROS2 does not require a ROS master node to manage communication which was a single point
failure.
--ROS2 supports multiple programming languages such as C++, Python, Java, Rust, etc.
*The developers are shifting from ROS to ROS2 due to unavailiblity of distributions support such as :
--ROS Noetic was release in 2020 and it's the last ROS1 version having life till may,2025 whereas we
will have new version every year in ROS2 and LTS version in every 2 years.
*ROS was only supported by ubuntu but ROS2 is supported by Ubuntu , Windows and MacOs which
makes ROS2 more accessible and embedded.
*The developers used DDS(data distribution system) as the network protocol for all communication
that happens internally in ROS2 to use in critical infrastructures such as battleships.