Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
{
"name":"my_node",
"type":"Stop"
}{
"name":"node name",
"type": "MyBtNode",
...
}{
"name":"my_node",
"type":"LinearAngularDynamic",
"linear_var_name":"my_linear_vel",
"angular_var_name":"my_angular_vel",
"blackboard":{
"my_angular_vel":null,
"my_linear_vel":null
}
}class MyBtNode:
def __init__(self, arg1: str, arg2: int, arg3: float):
...{
"name":"node name",
"type": "MyBtNode",
"arg1": "hello world",
"arg2": 4,
"arg3": 10.8
}{
"name":"reached_goal",
"type":"Sequencer",
"children":[
{
"name":"reached_position",
"type":"ReachedPosition",
"goal_pos_var_name":"goal_pos",
"error":0.05
},
{
"name":"stop",
"type":"Stop"
}
]
}
/mr_bt/src/tree_jsons/my_new_tree/
root.json
move.json
calculate_dist.json{
"name":"my_new_tree_root",
"type":"Sequencer",
"children":[
{
"ref":"my_new_tree/calculate_dist.json"
},
{
"ref":"my_new_tree/move.json"
}
]
}Publishes a twist message on the topic /cmd_vel with a linear and angular velocity provided by variables in the blackboard
Params:
linear_var_name (string): Name of the blackboard variable holding the linear x velocity to add to Twist msg
angular_var_name (string): Name of the blackboard variable holding the angular z velocity to add to Twist msgPublishes a Twist msg on /cmd_vel with all velocity values set to 0Returns "failure" if boolean variable in blackboard is true, otherwise returns "success".
Params:
var_name (string): name of boolean variable in blackboardReturns "success" if the position of the robot given by the /odom topic is close within error to the provided goal position variable
Params:
goal_pos_var_name (string): Name of the blackboard variable holding an array of the x,y goal coordinates.
error (float): Tolerated error for reaching the goal positionfrom ...nodes.action import Action
class MyActionNode(Action):
def __init__(self):
super().__init__()
def execute(self, blackboard: dict) -> str:
...from ...nodes.conditional import Conditional
class MyConditionalNode(Conditional):
def __init__(self):
super().__init__()
def condition(self, blackboard: dict) -> bool:
...from ...nodes.update import Update
class MyUpdateNode(Update):
def __init__(self):
super().__init__()
def update_blackboard(self, blackboard: dict) -> str:
...max_speedgoal_positionroot.json{
"name":"move_to_position",
"type":"Selector",
"children":[
...
],
"blackboard":{
"max_speed":0.5,
"goal_position":[1, 1]
}
}{
...
"blackboard":{
"current_position":null,
"reached_position":null
}
}{
"name":"Get my robot's position",
"type":"GetPosition",
"position_var_name":"current_position",
"blackboard":{
"current_position":null,
"/odom":"Odometry"
}
}{
...
"blackboard":{
"current_position":null,
"/odom":"Odometry"
}
}
{
...
"blackboard":{
"max_speed":0.5,
"goal_position":[1, 1]
}
}"blackboard":{
"current_position":null,
"/odom":"Odometry",
"max_speed":0.5,
"goal_position":[1, 1]
}{
"name":"goal_pid",
"type":"Multitasker",
"children":[
{
"name":"Calculate angular velocity necessary to face towards the position",
"type":"PathCorrection",
"correction_var_name":"angular_goal_pid",
"goal_value_var_name":"goal_rotation",
"current_value_var_name":"rotation",
"max_vel":1.5
},
{
"name":"Calculate linear velocity to get to position",
"type":"PathCorrection",
"correction_var_name":"linear_goal_pid",
"goal_value_var_name":"dist",
"current_value_var_name":"dummy_current_value",
"max_vel":0.1,
"offset":0
}
],
"blackboard":{
"angular_goal_pid":null,
"linear_goal_pid":null,
"dummy_current_value":0,
"dist":null
},
"blackbox":true
}root.jsontreemr_bt/src/tree_jsons/
my_new_bt_project/
root.json
action1.json
action2.json "command_1": {
"command_2": {
"receiver": "/cmd_vel",
"type": "geometry_msgs/Twist",
"msg" : {
"linear": {
"x": 0.2,
"y": 0.0,
"z": 0.0
},
"angular": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
}git clone https://github.com/vbelkina/whisper_4.git
pip install -r requirements.txt
sudo apt install ros-noetic-rosbridge-serverroslaunch whisper_4 command.launch device_index:=0 roslaunch rosbridge_server rosbridge_websocket.launch
rosrun whisper_4 execute.py
rosrun whisper_4 listen.py