-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/cleanup
- Loading branch information
Showing
16 changed files
with
258 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# External | ||
|
||
This folder consists of Git Submodules which are pulled in through the setup instructions. If you are missing any of the packages, run `git submodule --update` to pull then in again. | ||
Here is a list of the submodules: | ||
* BehaviorTree.ROS2: provides a set of C++ interfaces for BT.CPP to connect to ROS2. | ||
* Articubot One: an example project by [Articulated Robotics](https://www.youtube.com/@ArticulatedRobotics) which contains a URDF robot and navigation implementation. | ||
* Aruco ROS: a package designed for reading ARUCO tags and providing the transform to them relative to the robot. | ||
* NanoPB: a package which allow us to implement [Protocol Buffers](https://protobuf.dev/), a protocol for message transmission which allows us to communicate with our firmware. |
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,56 @@ | ||
import os | ||
from xacro import process_file | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from ament_index_python.packages import get_package_share_directory | ||
from launch.actions import IncludeLaunchDescription, RegisterEventHandler | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.event_handlers import OnProcessExit | ||
|
||
|
||
def generate_launch_description(): | ||
pkg_urc_bringup = get_package_share_directory("urc_bringup") | ||
|
||
controller_config_file_dir = os.path.join( | ||
pkg_urc_bringup, "config", "controller_config.yaml" | ||
) | ||
xacro_file = os.path.join( | ||
get_package_share_directory("urc_hw_description"), "urdf/walli.xacro" | ||
) | ||
assert os.path.exists(xacro_file), "urdf path doesnt exist in " + str(xacro_file) | ||
robot_description_config = process_file( | ||
xacro_file, mappings={"use_simulation": "false"} | ||
) | ||
robot_desc = robot_description_config.toxml() | ||
|
||
control_node = Node( | ||
package="controller_manager", | ||
executable="ros2_control_node", | ||
parameters=[controller_config_file_dir, {"robot_description": robot_desc}], | ||
output="both", | ||
) | ||
|
||
load_status_light_controller = Node( | ||
package="controller_manager", | ||
executable="spawner", | ||
arguments=["-p", controller_config_file_dir, "status_light_controller"], | ||
) | ||
|
||
bt_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
os.path.join(pkg_urc_bringup, "launch", "bt.launch.py") | ||
) | ||
) | ||
|
||
return LaunchDescription( | ||
[ | ||
control_node, | ||
load_status_light_controller, | ||
RegisterEventHandler( | ||
event_handler=OnProcessExit( | ||
target_action=load_status_light_controller, | ||
on_exit=[bt_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,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<root BTCPP_format="4"> | ||
<BehaviorTree ID="test_status_light"> | ||
<RunOnce then_skip="true"> | ||
<Sequence> | ||
<Delay delay_msec="100"> | ||
<StatusLightPublisher topic_name="/command/status_light" | ||
color="red" | ||
state="blink"/> | ||
</Delay> | ||
<Delay delay_msec="100"> | ||
<StatusLightPublisher topic_name="/command/status_light" | ||
color="red" | ||
state="off"/> | ||
</Delay> | ||
<Delay delay_msec="100"> | ||
<StatusLightPublisher topic_name="/command/status_light" | ||
color="green" | ||
state="blink"/> | ||
</Delay> | ||
<Delay delay_msec="100"> | ||
<StatusLightPublisher topic_name="/command/status_light" | ||
color="green" | ||
state="off"/> | ||
</Delay> | ||
<Delay delay_msec="100"> | ||
<StatusLightPublisher topic_name="/command/status_light" | ||
color="blue" | ||
state="blink"/> | ||
</Delay> | ||
<Delay delay_msec="100"> | ||
<StatusLightPublisher topic_name="/command/status_light" | ||
color="blue" | ||
state="off"/> | ||
</Delay> | ||
</Sequence> | ||
</RunOnce> | ||
</BehaviorTree> | ||
|
||
<!-- Description of Node Models (used by Groot) --> | ||
<TreeNodesModel> | ||
<Action ID="StatusLightPublisher" | ||
editable="true"> | ||
<input_port name="topic_name" | ||
default="/command/status_light"/> | ||
<input_port name="color"/> | ||
<input_port name="state"/> | ||
</Action> | ||
</TreeNodesModel> | ||
|
||
</root> |
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
49 changes: 40 additions & 9 deletions
49
urc_bt_nodes/include/urc_bt_nodes/actions/status_light_publisher.hpp
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
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
Oops, something went wrong.