hsr-project / hsr_ros2_doc

6 stars 1 forks source link

ros2_control_node died #6

Closed y-masutani closed 4 months ago

y-masutani commented 5 months ago

After the install described in issue #5, I stopped docker.hsrb.roscore.service, released the stop button, and executed the following command,

ros2 launch hsrb_bringup hsrb.launch.py

However, an error appeared immediately.

[INFO] [launch]: All log files can be found below /home/masutani/.ros/log/2024-02-09-04-52-52-549957-hsrb-33170
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [33185]
[ERROR] [ros2_control_node-1]: process has died [pid 33185, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_hu07z5nk --params-file /home/masutani/hsr_ros2_ws/install/hsrb_bringup/share/hsrb_bringup/config/controllers.yaml --params-file /tmp/launch_params_x8pwv3ze -r odom:=~/wheel_odom'].

(omitting the rest)

The ros2_control_node died.

How can I check to solve this?

y-masutani commented 5 months ago

I missed the message about ros2_control_node in the launch screen output as follows

[ros2_control_node-1] [WARN] [1707454373.341672747] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[ros2_control_node-1] [FATAL] [1707454373.352680649] [controller_manager]: System cannot communicate with servo motors. Error message: Permission denied
[ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error'
[ros2_control_node-1]   what():  Failed to configure 'hsrb'

It seems to contain two problems.

How do I solve tem?

y-masutani commented 5 months ago

I followed the code and found that the servo's device file is /dev/ttyCTI2.

https://github.com/hsr-project/hsrb_robot_hardware/blob/main/src/hsrb_robot_hardware/hsrb_hw.cpp#L43

ls -l /dev/ttyCTI2
crw-rw---- 1 root dialout 234, 2  2月  9 08:21 /dev/ttyCTI2

I ran the following, but it did not make any difference.

sudo adduser masutani dialout

where masutani is my user name.

I did the following, then ros2_control_node is not dead.

sudo chmod a+rw /dev/ttyCTI2

Is this procedure appropriate?

k-takeshita commented 4 months ago

Was the user "masutani" created using the adduser command? If a user was created with the adduser command, the user should have the necessary permissions. https://docs.hsr.io/hsrc_user_manual_en/howto/pc_setup_for_robot.html#id10

y-masutani commented 4 months ago

Yes. I used adduser command to create the account.

y-masutani commented 4 months ago

How can I check my permission on HSR? I checked /etc/groups and tried add my account to some groups.

k-takeshita commented 4 months ago

The added user should have the following permissions. You can check this by using the 'groups' command while logged in as that user.

dialaout, audio, video, plugdev, pulse, realtime-control, gpio

y-masutani commented 4 months ago

Today I used the groups command to see which groups my account belongs to.

$ groups
masutani dialout sudo audio video plugdev pulse realtime-control gpio

I checked /dev/ttyCTI2.

$ ls -l /dev/ttyCTI2
crw-rw---- 1 root dialout 234, 2  2月 13 09:24 /dev/ttyCTI2

The permissions on /dev/ttyCTI2 were restored.

But, I stopped docker.hsrb.roscore.service, released the stop button, and executed the following command,

$ ros2 launch hsrb_bringup hsrb.launch.py

Then I confirmed that ros2_control_node did not die, that the HSR arm worked through action communication, and that the camera nodes published Image topic.

I can't tell the difference from the last time.