-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproduced current status of gazebo_ros2_control #3
Comments
Thank you for your great project! I have one question. https://github.com/ros-simulation/gazebo_ros2_control/blob/5942107c360a7f07c546565f59cc51f2c5c6b380/gazebo_ros2_control_demos/examples/example_position.cpp#L126-L127 ->
cart_pole_controller:
ros__parameters:
type: ros_controllers::JointStateController As the result, I succeed to launch import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_context import LaunchContext
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
import xacro
def generate_launch_description():
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory('gazebo_ros'), 'launch'), '/gazebo.launch.py']),
)
gazebo_ros2_control_demos_path = os.path.join(
get_package_share_directory('gazebo_ros2_control_demos'))
xacro_file = os.path.join(gazebo_ros2_control_demos_path, 'urdf', 'test_cart_position.xacro.urdf')
config_file = os.path.join(gazebo_ros2_control_demos_path, 'config', 'cartpole_controller.yaml')
urdf_path = os.path.join(gazebo_ros2_control_demos_path, 'urdf', 'test_cart_position.urdf')
doc = xacro.process_file(xacro_file)
robot_desc = doc.toprettyxml(indent=' ')
f = open(urdf_path, 'w')
f.write(robot_desc)
f.close()
node_robot_state_publisher = Node(
package='robot_state_publisher',
node_executable='robot_state_publisher',
output='screen', #screen
arguments=[urdf_path]#params
)
spawn_entity = Node(package='gazebo_ros', node_executable='spawn_entity.py',
arguments=['-file', urdf_path, '-entity', 'cartpole'],
output='screen')
return LaunchDescription([
gazebo,
node_robot_state_publisher,
spawn_entity
]) And, I executed To detect Action Server, they need Thank you. |
Revert the JointTrajectoryController change and checkout https://github.com/ros-controls/ros2_controllers for the action server commit. It's not in eloquent yet. |
@ahcorde as @oktkhr0916 's comment highlights, you never mentioned which distro you used, please add this to the opening post. |
I'm working with Foxy. Updated the opening post. |
@bmagyar Thank you! It's work with eloquent.
|
@ahcorde I am trying to reproduce what you did but having trouble. First I tried exactly your instructions but got SEGV in gzserver. So I updated the joint limits and transmission modules to sync with master and #ros2_control/134. I also updated your gazebo_ros2_control and gazebo plugin code to work with recent master changes. It almost works but I believe I am getting some initialization happening out of order due to recent ControllerManager changes, take a look at my snipped of verbose output: Output shows gazebo_ros2_control plugin is initialized. It registers the slider_to_cart joint, but when the cart_pole_controller is initialized it is looking for a "joints" parameter that is not declared yet. We can see the declaration happens after the controller initialization (and the "no joint names specified" error). I believe this is a change in the ControllerManager behavior. CM no longer has the configure() and activate() methods...did CM used to be a Lifecycle node? It seems like previous behavior was controllers were constructed in load_controller() call but then later initialized in configure() but in the new behavior they are initialized in the load_controller() method and therefor they expect the joints parameter before your yaml processing explicitly declares them. ControllerManager::load_controller() does in fact call init() on the created controller instance (controller_manager.cpp:445). I am not sure how to proceed from here. thoughts?
|
Hello @guru-florida, I had updated the code with the recent changes in ros2_control and ros2_controllers in this PR #34 Let me know if you have more issues. |
Package is released |
I have created two PRs where I have added:
The ROS 2 distro used for this tutorial is Foxy
Run the demos:
Running the examples
I created two examples:
hardware_interface/PositionJointInterface
andhardware_interface/VelocityJointInterface
. I only made it work thePositionJointInterface
exampleLaunch the Gazebo classic world with the gazebo_ros2_plugin
Call the action
follow_joint_trajectories
:Check
/joint_states
or/state
Dependencies
@chapulina @Karsten1987 @ddengster
The text was updated successfully, but these errors were encountered: