-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from kumarkrishna/devel
Added data packet to be published.
- Loading branch information
Showing
10 changed files
with
181 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
# Single Robot | ||
Description: Controls N agents by deploying the same code N times using ROS for Swarm behavior simulation. | ||
|
||
Dependencies: ROS, Gazebo, Swarm Simulator | ||
Dependencies: ROS, Gazebo, [Swarm Simulator](https://github.com/Swarm-IITKgp/swarm_simulator) | ||
|
||
======Usage:====== | ||
|
||
1. Clone this Repository. | ||
|
||
2. Run the Swarm Simulator. [Swarm Simulator Repository should be in the system] | ||
|
||
'' roslaunch swarm_simulator swarm.launch '' | ||
```sh | ||
$ roslaunch swarm_simulator swarm.launch '' | ||
``` | ||
|
||
3. Run '' roslaunch singlerobot robotcontrol.launch '' to run this node. | ||
|
||
Use --screen to print the position of the current robot in x,y,z | ||
3. Generate the launch file for the singlerobot package for n-agents | ||
|
||
```sh | ||
roscd singlerobot | ||
bash generator.sh <number of agents> | ||
``` | ||
|
||
4. Launch the singlerobot nodes. | ||
|
||
```sh | ||
roslaunch singlerobot singlerobot.launch | ||
``` | ||
|
||
The messages are published at /swarmbot0/message and similarly for others. | ||
|
||
======TODO:====== | ||
|
||
1. Edit Roslaunch to deploy same code N times. | ||
|
||
2. Implement a naive path planner to take robot from Point A to Point B. | ||
1. Implement a naive path planner to take robot from Point A to Point B. | ||
|
||
3. Subscribe to encoder data for sibgle robot and generate path from that. | ||
2. Subscribe to encoder data for single robot and generate path from that. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
<launch> | ||
<node pkg ="singlerobot" type="singlerobot" name="swarmrobot" respawn="true"/> | ||
|
||
<arg name="botname"/> | ||
<arg name="botID"/> | ||
<param name="ID" value="$(arg botID)"/> | ||
<param name="NAME" value="$(arg botname)"/>bot | ||
<node pkg ="singlerobot" type="singlerobot" name="$(arg botname)" respawn="false"/> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<launch> | ||
<group ns="swarmbot0"> | ||
<param name="ID" value="0"/> | ||
<param name="NAME" value="swarmbot0"/> | ||
<node pkg="singlerobot" type="singlerobot" name="swarmbot0" respawn="false" /> | ||
</group> | ||
|
||
<group ns="swarmbot1"> | ||
<param name="ID" value="1"/> | ||
<param name="NAME" value="swarmbot1"/> | ||
<node pkg="singlerobot" type="singlerobot" name="swarmbot1" respawn="false" /> | ||
</group> | ||
|
||
<group ns="swarmbot2"> | ||
<param name="ID" value="2"/> | ||
<param name="NAME" value="swarmbot2"/> | ||
<node pkg="singlerobot" type="singlerobot" name="swarmbot2" respawn="false" /> | ||
</group> | ||
|
||
<group ns="swarmbot3"> | ||
<param name="ID" value="3"/> | ||
<param name="NAME" value="swarmbot3"/> | ||
<node pkg="singlerobot" type="singlerobot" name="swarmbot3" respawn="false" /> | ||
</group> | ||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int32 id | ||
time stamp | ||
pose[] table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
int32 id | ||
float64 x | ||
float64 y | ||
float64 theta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import sys | ||
|
||
|
||
''' This is the generator python script for generating the .launch file for n-agents. | ||
The script needs to be improved to accomomodate additions at a later point. | ||
TODO: | ||
Port to xml tree parser with some library like lxml for python. | ||
''' | ||
def main( n): | ||
print "<launch>" | ||
for i in range(0,n): | ||
newbot="" | ||
botname="swarmbot" | ||
botname+=str(i) | ||
newbot+="""<group ns=""" | ||
newbot+="\"" + str(botname) + "\"" | ||
newbot+=""">\n""" | ||
botID=i | ||
newbot+="""<param name="ID" value=""" | ||
newbot+="\"" + str(botID) + "\"" | ||
newbot+="""/>\n""" | ||
newbot+="""<param name="NAME" value=""" | ||
newbot+="\"" + str(botname) + "\"" | ||
newbot+="""/>\n""" | ||
newbot+="""<node pkg="singlerobot" type="singlerobot" name=""" | ||
newbot+="\""+str(botname)+"\"" | ||
newbot+=""" respawn="false" />""" | ||
newbot+="\n" | ||
newbot+="""</group>\n""" | ||
print newbot | ||
print "</launch>" | ||
|
||
if __name__ == '__main__': | ||
main(int(sys.argv[1])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
n=$1 | ||
python scripts/generator.py $n > launch/singlerobot.launch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters