Agrarsense
Using AGRARSENSE Walkers

Documentation

Topic Link
Getting Started Getting Started
Using the Simulator Using the Simulator
Using Vehicles Using Vehicles
Using Walkers Using Walkers
Sensors Sensors
Creating own maps Creating own maps
Building from source on Linux Building on Linux
Building from source on Windows Building on Windows
Installing on Linux Installing on Linux
Installing on Windows Installing on Windows

Walker System Basics

The Simulator Walker system allows to spawn few types of Walkers and also allows making Walkers that are either Stationary, Roam randominly across the map or be set to follow given path. Any spawned Walker can also be overriden to Walk or teleported to given location.

The Simulator has following types of Walkers.

type model
walker Reindeer
walker Moose
walker Worker

When spawning a Walker you need to define few parameters:

WalkerSpeed - Speed of the Walker

WalkerAction - What is the Walker action type: Stationary / Roaming / Follow path

WalkerEndAction - What does the Walker do when destionation is reached: Destroy / Repeat from start / Go backwards / Stop until destroyed manually

When spawning Walker with WalkerAction of Stationary or Roaming, WalkerEndAction is ignored.

Spawning Walkers through User Interface

Asset placement spawning walkers

  1. Open Asset Placement tool from right top menu toolbar menu
  2. Open the Walkers-tab
  3. Select Walker you want to spawn
  4. Select desired Walker parameters:

    4.1 Select Walker Action

    4.2 Select Movement End Action

    4.3 Select Walker Speed with the SPEED-slider

  5. Select position you want Walker to spawned with left click. If selected Walker Action is Follow path, you need to select at least two points and then you can click Spawn Walker.

Asset placement walker menu

Exporting Walkers into JSON files through user interface

After spawning Walker or multiple Walker, you can export all of them into separate JSON files by clicking "Export Walkers" button in the Walker user interface, and then giving a filename to use as prefix for the files.

Walker(s) will be exported into SIMULATOR_ROOT/Data/ExportedJsonFiles directory and the JSON file(s) will include Walker type and its current parameters.

Walker export

Exporting Walkers into JSON files through ROS

Walker(s) will be exported into SIMULATOR_ROOT/Data/ExportedJsonFiles directory and the JSON file(s) will include Walker type and its current parameters.

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "ExportWalkers" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: ExportWalkers" --once

Destroying Walkers through User Interface

To destroy all Walkers:

  1. Open Asset Placement tool from right top menu toolbar menu
  2. Open the Walkers-tab
  3. Click "Delete All" and then click "Confirm".

To destroy individual Walker:

  1. Right click Walker to open up a context menu. If menu is not showing up, make sure asset placement menu or any other openable menu is not open.
  2. Click Remove from the context menu

Destroying Walkers through ROS

To destroy all Walkers through ROS:

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "DestroyAllWalkers" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: DestroyAllWalkers" --once

To Destroy individual Walker through ROS:

# ROS 1 - where 'reindeer' is the ID of the Walker
rostopic pub /agrarsense/in/commands std_msgs/String "destroyobjectbyid reindeer" --once
# ROS 2 - where 'reindeer' is the ID of the Walker
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: destroyobjectbyid reindeer" --once

Spawning Stationary Walker through ROS

You can spawn Walker through ROS by using SpawnObjects command which takes .json file path.

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "SpawnObjects C:/Agrarsense/Examples/ExampleJsonFiles/walker_stationary.json" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: SpawnObjects C:/Agrarsense/Examples/ExampleJsonFiles/walker_stationary.json" --once

The .json file structure should look something like this:

{
"objects":
[
{
"type": "walker",
"model": "Reindeer",
"id": "reindeer",
"parameters":
{
"walkerAction": "Stationary",
"spawnPoint":
{
"x": 0.0,
"y": 0.0,
"z": 100.0,
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0
}
}
}
]
}

Spawning Roaming Walker through ROS

You can spawn Walker through ROS by using SpawnObjects command which takes .json file path.

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "SpawnObjects C:/Agrarsense/Examples/ExampleJsonFiles/walker_roaming.json" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: SpawnObjects C:/Agrarsense/Examples/ExampleJsonFiles/walker_roaming.json" --once

The .json file structure should look something like this:

{
"objects":
[
{
"type": "walker",
"model": "Reindeer",
"id": "reindeer",
"teleportSpectator": "false",
"followObject": "false",
"parameters":
{
"walkerSpeed": "50",
"walkerAction": "Roaming",
"spawnPoint":
{
"x": 0.0,
"y": 0.0,
"z": 2000.0,
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0
}
}
}
]
}

Spawning "Follow path" Walker through ROS

You can spawn Walker through ROS by using SpawnObjects command which takes .json file path.

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "SpawnObjects C:/Agrarsense/Examples/ExampleJsonFiles/walker_roaming.json" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: SpawnObjects C:/Agrarsense/Examples/ExampleJsonFiles/walker_roaming.json" --once

The .json file structure should look something like this:

{
"objects":
[
{
"type": "walker",
"model": "Reindeer",
"id": "reindeer",
"teleportSpectator": "false",
"followObject": "false",
"parameters":
{
"walkerSpeed": "50",
"walkerAction": "FollowPath",
"endAction": "RepeatFromBeginning",
"points":
{
"point0":
{
"x": 0.0,
"y": 0.0,
"z": 2000.0,
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0
},
"point1":
{
"x": -3360.0,
"y": 7750.0,
"z": 1430,
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0
},
"point2":
{
"x": -3350.0,
"y": 7100.0,
"z": 1430.0,
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0
}
}
}
}
]
}

Override Walker to move towards certain position

To override a Walker to start moving towards certain position you can use either ROS Command MoveWalkerTo or MoveWalkerToAndDestroy command.

MoveWalkerTo Command will command the Walker to start moving towards given position, and if Walker arrives at given position, the walker will stop until it is destroyed or new position is given.

Both of these commands take in ID X,Y,Z or ID X,Y,Z,Pitch,Roll,Yaw

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "MoveWalkerTo ID X,Y,Z" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: MoveWalkerTo ID X,Y,Z" --once
# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "MoveWalkerTo reindeer 0,0,0" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: MoveWalkerTo reindeer 0,0,0" --once

MoveWalkerToAndDestroy does almost the same as MoveWalkerTo command but if Walker arrives at given position it will destroy itself automatically.

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "MoveWalkerToAndDestroy reindeer 0,0,0" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: MoveWalkerToAndDestroy reindeer 0,0,0" --once

Note. The Simulator does check whether given path is reachable or not.

Pausing and resuming Walker through ROS

You can pause/resume Walker movement by using PauseWalker ID or ResumeWalker ID ROS Command like below:

# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "PauseWalker reindeer" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: PauseWalker reindeer" --once
# ROS1
rostopic pub /agrarsense/in/commands std_msgs/String "ResumeWalker reindeer" --once
# ROS2
ros2 topic pub /agrarsense/in/commands std_msgs/String "data: ResumeWalker reindeer" --once