noshluk2 / ros1_wiki

This repository contains video demonstration and explanation for ROS1 Wiki pages
MIT License
61 stars 20 forks source link

ROS turtle mover/formation #14

Closed engrvinzz closed 1 year ago

engrvinzz commented 1 year ago

Please provide an in sight to this for solving this.

Using a launch file to spawn 3 turtles, namely leader, followerA and followerB, in the turtlesim simulator • The leader turtle is located in the center with no rotation. The other 2 followers start at a random position and orientation. • Define a custom message namely YourBCodeLeaderMessage.msg as shown below used to send an instruction from the leader to two followers Fig. 1 The YourBcodeLeaderMessage.msg message to be defined • The leader starts with sending an instruction using the defined message to two followers asking them to move to the formation position, i.e. followerA is 1 meter behind the leader and followerB is 1 meter behind followerA as illustrated in • Once the leader detects that the two followers are in the required formation position, it turns to a random direction and then keep moving in a straight line with a red pen until it reaches the boundary of the turtlesim window. The three turtles should maintain column formation while moving, i.e. three turtles travel one after the other with two followers move with a white pen. Hints: The formation control could be easily achieved by publishing additional frames to the leader turtle. Here is the tutorial you might find helpful. . An illustration of leader-follower formation. i.e. followerA is 1 meter behind the leader and followerB is 1 meter behind the followerA • Defining a custom ROS service, namely YourBcodeServicePID.srv, which provides a service allowing a given turtle moves to a specified location using a PID controller as illustrated in Fig. 3. Hints: Here is a link which you can find how to use a PID controller to move a robot to a specific location • When the leader turtle approaches to the border, it will send another instruction (again using the defined message) to the followers and do the following o Teleport 2 followers to their initial position through the service (i.e. turtlesim/TeleportAbsolute) provided by ROS o The leader turtle returns to the center through the custom service defined above (i.e. YourBcodeServicePID.srv). If the PID server fails to move the turtle to the goal location, the leader turtle should be teleported back to the center o All the turtles should return to their initial position with a black pen • A Vodcast is required to be produced to accompany your implementation within which a brief walkthrough demonstration of your implementation and a walkthrough of the underlying source code, along with an associated commentary.

  1. Marking scheme • Using a launch file to spawn 3 turtles at required positions • Creating a custom ROS message, i.e. LeaderMessage.msg and a custom ROS service, i.e. ServicePID.srv • Communication between the leader and follower turtles using the defined message • The leader turtle moves in a random direction • The control of leader-follower formation • Turtles return to their initial position
noshluk2 commented 1 year ago

General Outline :

Define Files

engrvinzz commented 1 year ago

Can you please provide python code solution for this?

engrvinzz commented 1 year ago

Hi Mohammed,

Could you please proffer a python code solution to this issue?

Thanks.

On Wed, Apr 26, 2023, 1:57 AM Muhammad Luqman @.***> wrote:

Closed #14 https://github.com/noshluk2/ros1_wiki/issues/14 as completed.

— Reply to this email directly, view it on GitHub https://github.com/noshluk2/ros1_wiki/issues/14#event-9097822392, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6PXFLR4WJJXOHNV7AAM733XDBXJLANCNFSM6AAAAAAXJAFONE . You are receiving this because you authored the thread.Message ID: @.***>