Closed haavarpb closed 11 months ago
Thank you for your report and your excellent debugging skills. Indeed, the scaled interface is not available for the gazebo simulation as this is currently more or less a ur-specific feature. We hope to change this in the future, but we don't have any particular time frame ATM.
To circumvent this issue, it would be nice to use the use_fake_hardware
when we include the launch for moveit in ur_sim_moveit.launch.py
ur_moveit_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("ur_moveit_config"), "/launch", "/ur_moveit.launch.py"]
),
launch_arguments={
"ur_type": ur_type,
"safety_limits": safety_limits,
"description_package": description_package,
"description_file": description_file,
"moveit_config_package": moveit_config_package,
"moveit_config_file": moveit_config_file,
"prefix": prefix,
"use_sim_time": "true",
"use_fake_hardware": "True",
"launch_rviz": "true",
}.items(),
)
Hope this helps! I'll try to give in a PR, if the maintainers are interested.
@padhupradheep thanks for suggesting this. This will probably see some rework in the near future, since we've found the reason for https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/390. Hence, the automatic switch of the default controller will at least be renamed rather soon. When this is done, it is indeed a good idea to change the launchfile in here.
No problem.
"use_fake_hardware": "True",
Another interesting thing here is that, you definitely need to have capital T for "True". Else, there will be an error, when you use them with the Context. It could be interesting for other params as well during the rework.
I am using humble, the ur_sim_moveit.launch.py file has the following check
change_controllers = context.perform_substitution(use_fake_hardware)
if change_controllers == "true":
controllers_yaml["scaled_joint_trajectory_controller"]["default"] = False
controllers_yaml["joint_trajectory_controller"]["default"] = True
so I think for now "use_fake_hardware": "True", need to be "use_fake_hardware": "true",
This seems to boil down to a duplicate of #8, so closing this.
Hi,
after finally being able to run the gazebo simulation (needed to update ur_msgs dependency like in #10, update the locale LC_NUMERIC which was related to MoveIt2) I am having difficulties with moving the gazebo ur robot.
Starting the driver using
ros2 launch ur_simulation_gazebo ur_sim_moveit.launch.py
starts the system with the following controllers loaded:If I now move the ur robot using the Rviz with MoveIt, and hit Plan everything looks fine:
However, when I click Execute, this happens:
Ok, so it looks like MoveIt wants to talk to the
scaled_joint_trajectory_controller
(SJTC), while it's actuallyjoint_trajectory_controller
(JTC) that's loaded byros2 control
. Fair enough, after switching the default controller inur_moveit_config/config/controllers.yaml
from the SJTC to JTC, I am able to move the gazebo robot!Now, as an exercise, I looked into if I could manage to use the SJTC instead. First thing I tried is to unload JTC, and then load-configure-start the SJTC through
ros2 control
. This results in the following messages:Based on these messages, the ros control architecture and the explanation of the different
ur_controllers
here I decided to try and start thespeed_scaling_state_broadcaster
instead of thejoint_state_broadcaster
hoping that these are equivalent besides that the former also publishes the requiredspeed_scaling/speed_scaling_factor
. Hope is not enough, as it didn't work...I am at my limit of my ROS2 knowledge here, but I will continue to try. However, I am dropping this here to see if anyone knows how I can configure the UR robot to use the SJTC.
PS: I feel like using the
ros2 control
interface is the wrong thing to do here, as moveit adds a node called/moveit_simple_controller_manager
which seems to invokeros2 control
, however I have not found a way to tell it to switch controllers. Looking into the moveit repo, it seems that there might be an implementation of aMoveItControllerManager
that could help, but I am unable to see how I would approach incorporating it. It seems that this thread is relevant as well.Thanks for any help, and sorry if this is inappropriate.