Skip to content

Commit

Permalink
Add launch file
Browse files Browse the repository at this point in the history
  • Loading branch information
hbuurmei committed Sep 27, 2024
1 parent 2586d2d commit 10494e2
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
# External packages
**/mocap_msgs/
**/mocap4r2/
**/mocap4ros2_optitrack/
**/mocap4ros2_optitrack/
**/ros_phoenix/*

# Maintain version control of launch files
!**/ros_phoenix/launch/
**/ros_phoenix/launch/*
!**/ros_phoenix/launch/trunk.launch.py
1 change: 0 additions & 1 deletion stack/motors/src/interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ rosidl_generate_interfaces(${PROJECT_NAME}
"msg/AllMotorsStatus.msg"
"msg/SingleMotorControl.msg"
"msg/SingleMotorStatus.msg"
"srv/MPCCommand.srv"
)

if(BUILD_TESTING)
Expand Down
3 changes: 0 additions & 3 deletions stack/motors/src/interfaces/srv/MPCCommand.srv

This file was deleted.

55 changes: 55 additions & 0 deletions stack/motors/src/ros_phoenix/launch/trunk.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import launch
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode


def generate_launch_description():
"""Generate trunk motors launch description with all motors."""
container = ComposableNodeContainer(
name="PhoenixContainer",
namespace="",
package="ros_phoenix",
executable="phoenix_container",
parameters=[{"interface": "can0"}],
composable_node_descriptions=[
ComposableNode(
package="ros_phoenix",
plugin="ros_phoenix::TalonSRX",
name="talon1",
parameters=[{"id": 1, "P": 1.0, "D": 0.001, "period_ms": 1000, "watchdog_ms": 2000}],
),
ComposableNode(
package="ros_phoenix",
plugin="ros_phoenix::TalonSRX",
name="talon2",
parameters=[{"id": 2, "P": 1, "D": 0.0, "period_ms": 1000, "watchdog_ms": 2000}],
),
ComposableNode(
package="ros_phoenix",
plugin="ros_phoenix::TalonSRX",
name="talon3",
parameters=[{"id": 3, "P": 0.1, "D": 0.001, "period_ms": 1000, "watchdog_ms": 2000}],
),
ComposableNode(
package="ros_phoenix",
plugin="ros_phoenix::TalonSRX",
name="talon4",
parameters=[{"id": 4, "P": 0.1, "D": 0.001, "period_ms": 1000, "watchdog_ms": 2000}],
),
ComposableNode(
package="ros_phoenix",
plugin="ros_phoenix::TalonSRX",
name="talon5",
parameters=[{"id": 5, "P": 0.1, "D": 0.001, "period_ms": 1000, "watchdog_ms": 2000}],
),
ComposableNode(
package="ros_phoenix",
plugin="ros_phoenix::TalonSRX",
name="talon6",
parameters=[{"id": 6, "P": 0.1, "D": 0.001, "period_ms": 1000, "watchdog_ms": 2000}],
),
],
output="screen",
)

return launch.LaunchDescription([container])

0 comments on commit 10494e2

Please sign in to comment.