ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Pthread set sched policy failed

asked 2022-07-28 01:52:42 -0600

mirakim gravatar image

I am using ROS to control the Unitree A1,

But when I run the roslaunch command, this error keeps showing.

process[node_lcm_server_running-1]: started with pid [919816] Error: Pthread set sched policy failed. process[unitree_base_node-2]: started with pid [919817] [node_lcm_server_running-1] process has died [pid 919816, exit code 254, cmd /home/user/catkin_ws/devel/lib/unitree_base/lcm_server_running_node a1 highlevel __name:=node_lcm_server_running __log:=/home/user/.ros/log/114485b2-0e2f-11ed-9046-4b1a6b229934/node_lcm_server_running-1.log].

I've read the second log file while the first log isn't even made,

Error: Lock memory failed.

I think the error message is related to the first error message which is exit 254: pthread set sched policy failed.

Is there anybody who have experienced this error or the one similar to this?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-07-28 07:33:38 -0600

Mike Scheutzow gravatar image

The pthread_attr_setschedpolicy() call succeeds only if the ros node is run by the root user. You will need to decide if the increased risk is worthwhile.

edit flag offensive delete link more


Thank you for the info! Actually, I cannot get anything related to ROS on root. Do I have to install all things in root environment again or can I run the roslaunch command after 'sudo'? - I ran the roslaunch command after 'sudo' and it says sudo: roslaunch: command not found Thanks in advance! :)

mirakim gravatar image mirakim  ( 2022-07-29 02:20:10 -0600 )edit

I figured out that adding the tag such as launch-prefix='sudo' helps the node to run by the root user. Thank you so much! :)

mirakim gravatar image mirakim  ( 2022-07-29 03:17:00 -0600 )edit

May I ask another question? I get another error

process[node_lcm_server_running-1]: started with pid [4513]

Error: Lock memory failed. [node_lcm_server_running-1] process has died [pid 4513, exit code 254, cmd sudo /root/catkin_ws/devel/lib/unitree_base/lcm_server_running_node a1 highlevel __name:=node_lcm_server_running __log:=/root/.ros/log/1c904e4a-10fc-11ed-84a2-48b02d15e5cb/node_lcm_server_running-1.log]. log file: /root/.ros/log/1c904e4a-10fc-11ed-84a2-48b02d15e5cb/node_lcm_server_running-1*.log

This error message seems to be another problem, Would you please let me know what is going on?

For additional information, I am running this file in docker, with M1 chip, in root mode.

Thanks in advance :)

mirakim gravatar image mirakim  ( 2022-08-04 04:06:31 -0600 )edit

The app could be trying to create a shared memory region, but my guess is that containers are not allowed to do that by default. There might be an option you can pass to docker to allow it, but I don't know what option that would be.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-08-04 08:21:37 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-07-28 01:52:42 -0600

Seen: 33 times

Last updated: Jul 28