-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created test for single joint, commands via subscriber not working
- Loading branch information
1 parent
a6df9bc
commit b59477b
Showing
10 changed files
with
528 additions
and
13 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
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
32 changes: 32 additions & 0 deletions
32
joint_controller_ros2_control/test/bringup/config/single_joint_test.yaml
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,32 @@ | ||
controller_manager: | ||
ros__parameters: | ||
update_rate: 500 # Hz | ||
|
||
joint_state_broadcaster: | ||
type: joint_state_broadcaster/JointStateBroadcaster | ||
|
||
joint_controller: | ||
type: joint_controller/JointController | ||
|
||
|
||
joint_controller: | ||
ros__parameters: | ||
joint_names: | ||
- body_1_joint | ||
|
||
joint_params: | ||
body_1_joint: | ||
position_max: 3.14 | ||
position_min: -3.14 | ||
position_offset: 0.0 | ||
velocity_max: 10.0 | ||
effort_max: 10.0 | ||
|
||
frequency: 500.0 | ||
|
||
pid_gains: | ||
body_1_joint: | ||
p: 1.0 | ||
d: 0.0 | ||
i: 0.0 | ||
ilimit: 1.0 |
96 changes: 96 additions & 0 deletions
96
joint_controller_ros2_control/test/bringup/launch/rviz.launch.py
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,96 @@ | ||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, RegisterEventHandler | ||
from launch.conditions import IfCondition | ||
from launch.event_handlers import OnProcessExit | ||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution | ||
|
||
from launch_ros.actions import Node | ||
from launch_ros.substitutions import FindPackageShare | ||
|
||
from launch_ros.parameter_descriptions import ParameterValue | ||
|
||
|
||
def generate_launch_description(): | ||
# Declare arguments | ||
declared_arguments = [] | ||
|
||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"gui", | ||
default_value="true", | ||
description="Start RViz2 automatically with this launch file.", | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"package", | ||
default_value="joint_controller", | ||
) | ||
) | ||
|
||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"urdf_file", | ||
default_value="single_joint_test.urdf.xacro", | ||
) | ||
) | ||
|
||
|
||
# Initialize Arguments | ||
package_name = LaunchConfiguration("package") | ||
urdf_file = LaunchConfiguration("urdf_file") | ||
|
||
# Get URDF via xacro | ||
robot_description_content = ParameterValue( | ||
Command( | ||
[ | ||
PathJoinSubstitution([FindExecutable(name="xacro")]), | ||
" ", | ||
PathJoinSubstitution( | ||
[ | ||
FindPackageShare(package_name), | ||
"urdf", | ||
urdf_file, | ||
] | ||
), | ||
] | ||
), value_type=str) | ||
robot_description = {"robot_description": robot_description_content} | ||
|
||
# rviz_config_file = PathJoinSubstitution( | ||
# [FindPackageShare("ros2_control_demo_description"), "rrbot/rviz", "rrbot.rviz"] | ||
# ) | ||
|
||
robot_state_pub_node = Node( | ||
package="robot_state_publisher", | ||
executable="robot_state_publisher", | ||
output="both", | ||
parameters=[robot_description], | ||
) | ||
|
||
joint_state_publisher_gui = Node( | ||
package = "joint_state_publisher_gui", | ||
executable = "joint_state_publisher_gui", | ||
) | ||
|
||
# Initialize Arguments | ||
gui = LaunchConfiguration("gui") | ||
|
||
rviz_node = Node( | ||
package="rviz2", | ||
executable="rviz2", | ||
name="rviz2", | ||
output="log", | ||
# arguments=["-d", rviz_config_file], | ||
condition=IfCondition(gui), | ||
) | ||
|
||
|
||
|
||
nodes = [ | ||
robot_state_pub_node, | ||
joint_state_publisher_gui, | ||
rviz_node | ||
] | ||
|
||
return LaunchDescription(declared_arguments + nodes) |
Oops, something went wrong.