Skip to content
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

Invalid parameter when initializing #1

Open
avegetablechicken opened this issue Apr 7, 2022 · 8 comments
Open

Invalid parameter when initializing #1

avegetablechicken opened this issue Apr 7, 2022 · 8 comments

Comments

@avegetablechicken
Copy link

avegetablechicken commented Apr 7, 2022

I install ros melodic on ubuntu18.04 and compile oslsim according instructions. However, when i was running roslaunch oslsim main.launch control:=true, there existed an error as below:

$ roslaunch oslsim main.launch control:=true

... logging to /home/user/.ros/log/7cc08b3c-b647-11ec-8165-30d042e761b4/dell-3175.log

Checking log directory for disk usage. This may take a while.

Press Ctrl-C to interrupt

Done checking log file disk usage. Usage is <1GB.



Invalid parameter "robot_ns"

when instantiating macro: dc_motor (/home/user/catkin_ws/src/gazebo_ros_motors/xacro/dc_motor.xacro)

in file: /home/user/catkin_ws/src/oslsim/urdf/oslsim.xacro

RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/melodic/lib/xacro/xacro', '/home/user/catkin_ws/src/oslsim/urdf/oslsim.xacro']] returned with code [2]. 



Param xml is <param command="$(find xacro)/xacro '$(find oslsim)/urdf/oslsim.xacro'" name="robot_description"/>

The traceback for the exception was written to the log file

It seems that dc_motor.xacro in gazebo does not support robot_ns. How can I figure it out?

@avegetablechicken
Copy link
Author

avegetablechicken commented Apr 7, 2022

I got to run the program by deleting "robot_ns" propety in $(find oslsim)/urdf/oslsim.xacro and resetting gazebo_ros_motors to the commit before "allow specifying axis". But simulation could not carry on. The program ran into segment fault.

@avegetablechicken
Copy link
Author

avegetablechicken commented Apr 7, 2022

I got to run the program by deleting "robot_ns" propety in $(find oslsim)/urdf/oslsim.xacro and resetting gazebo_ros_motors to the commit before "allow specifying axis". But simulation could not carry on. The program ran into segment fault.

current console output

$ roslaunch oslsim main.launch control:=true

... logging to /home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/roslaunch-user-Precision-3640-Tower-24256.log

Checking log directory for disk usage. This may take a while.

Press Ctrl-C to interrupt

Done checking log file disk usage. Usage is <1GB.



Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.

Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.

started roslaunch server http://user-Precision-3640-Tower:45817/



SUMMARY

========



PARAMETERS

 * /gazebo/enable_ros_network: True

 * /oslsim/ankle_position_controller/joint: ankle

 * /oslsim/ankle_position_controller/pid/d: 0.01

 * /oslsim/ankle_position_controller/pid/i: 0.1

 * /oslsim/ankle_position_controller/pid/p: 10

 * /oslsim/ankle_position_controller/type: effort_controller...

 * /oslsim/hip_position_controller/joint: hip

 * /oslsim/hip_position_controller/pid/d: 0.01

 * /oslsim/hip_position_controller/pid/i: 0.1

 * /oslsim/hip_position_controller/pid/p: 10

 * /oslsim/hip_position_controller/type: effort_controller...

 * /oslsim/joint_state_controller/publish_rate: 50

 * /oslsim/joint_state_controller/type: joint_state_contr...

 * /oslsim/knee_position_controller/joint: knee

 * /oslsim/knee_position_controller/pid/d: 0.01

 * /oslsim/knee_position_controller/pid/i: 0.1

 * /oslsim/knee_position_controller/pid/p: 10

 * /oslsim/knee_position_controller/type: effort_controller...

 * /oslsim/osl_hip_position_controller/joint: osl_hip

 * /oslsim/osl_hip_position_controller/pid/d: 0.01

 * /oslsim/osl_hip_position_controller/pid/i: 0.1

 * /oslsim/osl_hip_position_controller/pid/p: 10

 * /oslsim/osl_hip_position_controller/type: effort_controller...

 * /robot_description: <?xml version="1....

 * /robot_state_publisher/ignore_timestamp: True

 * /robot_state_publisher/publish_frequency: 50.0

 * /robot_state_publisher/tf_prefix: oslsim

 * /rosdistro: melodic

 * /rosversion: 1.14.13

 * /use_sim_time: True



NODES

  /

    gazebo (gazebo_ros/gzserver)

    gazebo_gui (gazebo_ros/gzclient)

    loadcell (oslsim/loadcell.py)

    oslsim_controller (oslsim/controller.py)

    oslsim_pid_tuner (oslsim/tuner.py)

    oslsim_walker (oslsim/walk.py)

    robot_state_publisher (robot_state_publisher/robot_state_publisher)

    urdf_spawner (gazebo_ros/spawn_model)

  /oslsim/

    controller_spawner (controller_manager/spawner)



auto-starting new master

process[master]: started with pid [24269]

ROS_MASTER_URI=http://localhost:11311



setting /run_id to ee9d0af2-b64f-11ec-8165-30d042e761b4

process[rosout-1]: started with pid [24280]

started core service [/rosout]

process[gazebo-2]: started with pid [24287]

process[gazebo_gui-3]: started with pid [24292]

process[urdf_spawner-4]: started with pid [24297]

process[robot_state_publisher-5]: started with pid [24298]

process[oslsim/controller_spawner-6]: started with pid [24299]

process[loadcell-7]: started with pid [24301]

process[oslsim_walker-8]: started with pid [24306]

process[oslsim_controller-9]: started with pid [24308]

process[oslsim_pid_tuner-10]: started with pid [24311]

Traceback (most recent call last):

  File "/home/user/catkin_ws/src/oslsim/scripts/tuner.py", line 3, in <module>

    from pid_tune.msg import PidTune

ImportError: No module named pid_tune.msg

**[oslsim_pid_tuner-10] process has died [pid 24311, exit code 1, cmd /home/user/catkin_ws/src/oslsim/scripts/tuner.py __name:=oslsim_pid_tuner __log:=/home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/oslsim_pid_tuner-10.log].**

log file: /home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/oslsim_pid_tuner-10*.log

[ INFO] [1649321497.328313550]: Finished loading Gazebo ROS API Plugin.

[ INFO] [1649321497.329255534]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...

[ INFO] [1649321497.379634393]: Finished loading Gazebo ROS API Plugin.

[ INFO] [1649321497.380564372]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...

[INFO] [1649321497.421449, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller

Traceback (most recent call last):

  File "/home/user/catkin_ws/src/oslsim/scripts/controller.py", line 7, in <module>

    from pid_tune.msg import PidTune

ImportError: No module named pid_tune.msg

**[oslsim_controller-9] process has died [pid 24308, exit code 1, cmd /home/user/catkin_ws/src/oslsim/scripts/controller.py __name:=oslsim_controller __log:=/home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/oslsim_controller-9.log].**

log file: /home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/oslsim_controller-9*.log

[ INFO] [1649321497.932864370]: waitForService: Service [/gazebo/set_physics_properties] is now available.

[ INFO] [1649321497.943053186]: Physics dynamic reconfigure ready.

[ INFO] [1649321498.206633334]: <initialOrientationAsReference> set to: 0

[ INFO] [1649321498.206680501]: <robotNamespace> set to: /oslsim/

[ INFO] [1649321498.206698697]: <topicName> set to: /oslsim/imu/osl_shank

[ INFO] [1649321498.206713168]: <frameName> set to: osl_shank

[ INFO] [1649321498.206735281]: <updateRateHZ> set to: 50

[ INFO] [1649321498.206750341]: <gaussianNoise> set to: 0

[ INFO] [1649321498.206769913]: <xyzOffset> set to: 0 0 0

[ INFO] [1649321498.206795379]: <rpyOffset> set to: 0 -0 0

[ INFO] [1649321498.208368022]: <initialOrientationAsReference> set to: 0

[ INFO] [1649321498.208383085]: <robotNamespace> set to: /oslsim/

[ INFO] [1649321498.208396086]: <topicName> set to: /oslsim/imu/foot

[ INFO] [1649321498.208408836]: <frameName> set to: osl_foot

[ INFO] [1649321498.208424771]: <updateRateHZ> set to: 50

[ INFO] [1649321498.208439017]: <gaussianNoise> set to: 0

[ INFO] [1649321498.208455464]: <xyzOffset> set to: 0 0 0

[ INFO] [1649321498.208471671]: <rpyOffset> set to: 0 -0 0

[ INFO] [1649321498.324499873]: Loading gazebo_ros_control plugin

[ INFO] [1649321498.324567161]: Starting gazebo_ros_control plugin in namespace: /oslsim

[ INFO] [1649321498.324978590]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.

[urdf_spawner-4] process has finished cleanly

log file: /home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/urdf_spawner-4*.log

[ INFO] [1649321498.436847194]: Loaded gazebo_ros_control.

[ INFO] [1649321498.443837555]: Starting plugin motor_plugin(ns = //)

[ INFO] [1649321498.443926353]: motor_plugin(ns = //): <rosDebugLevel> = Debug

[ INFO] [1649321498.444489905]: motor_plugin(ns = //): <tf_prefix> = 

[ INFO] [1649321498.444901992]: motor_nominal_voltage_ = 50.000000

[ INFO] [1649321498.444919998]: moment_of_inertia_ = 0.000100

[ INFO] [1649321498.444931599]: armature_damping_ratio_ = 0.000100

[ INFO] [1649321498.444942398]: electromotive_force_constant_ = 0.056000

[ INFO] [1649321498.444953314]: electric_resistance_ = 0.186000

[ INFO] [1649321498.444963743]: electric_inductance_ = 0.000138

[ WARN] [1649321498.445155824]: motor_plugin(ns = //): missing <velocity_noise> default is 0

[DEBUG] [1649321498.445188864]: motor_plugin(ns = //): <publish_velocity> = true

[DEBUG] [1649321498.445199067]: motor_plugin(ns = //): <publish_encoder> = true

[DEBUG] [1649321498.445207797]: motor_plugin(ns = //): <publish_current> = true

[DEBUG] [1649321498.445349379]: motor_plugin(ns = //): <publish_motor_joint_state> = true

[ INFO] [1649321498.445834935]: motor_plugin(ns = //): Advertise joint_state

[ INFO] [1649321498.445862046]: motor_plugin(ns = //): Trying to subscribe to osl_ankle/command

[ INFO] [1649321498.447438123]: motor_plugin(ns = //): Subscribed to osl_ankle/command

[ INFO] [1649321498.447453493]: motor_plugin(ns = //): Trying to subscribe to osl_ankle/supply_voltage

[ INFO] [1649321498.448331953]: motor_plugin(ns = //): Subscribed to osl_ankle/command

[ INFO] [1649321498.448606996]: motor_plugin(ns = //): Advertising motor shaft (before gearbox) velocity on osl_ankle/velocity 

[ INFO] [1649321498.448945363]: motor_plugin(ns = //): Advertising encoder counts on osl_ankle/encoder 

[ INFO] [1649321498.449175261]: motor_plugin(ns = //): Advertising actual motor current on osl_ankle/current 

[ INFO] [1649321498.449431699]: motor_plugin(ns = //): Setting up dynamic reconfigure server.

[ INFO] [1649321498.457797424]: Notifying parameter server...

[ INFO] [1649321498.458272143]: DC Motor parameters validated and updated

[ INFO] [1649321498.459888274]: Starting plugin motor_plugin(ns = //)

[ INFO] [1649321498.459921086]: motor_plugin(ns = //): <rosDebugLevel> = Debug

[ INFO] [1649321498.460172348]: motor_plugin(ns = //): <tf_prefix> = 

[ INFO] [1649321498.460261819]: motor_nominal_voltage_ = 50.000000

[ INFO] [1649321498.460276080]: moment_of_inertia_ = 0.000100

[ INFO] [1649321498.460286468]: armature_damping_ratio_ = 0.000100

[ INFO] [1649321498.460297090]: electromotive_force_constant_ = 0.056000

[ INFO] [1649321498.460314499]: electric_resistance_ = 0.186000

[ INFO] [1649321498.460331823]: electric_inductance_ = 0.000138

[ WARN] [1649321498.460351766]: motor_plugin(ns = //): missing <velocity_noise> default is 0

[DEBUG] [1649321498.460372132]: motor_plugin(ns = //): <publish_velocity> = true

[DEBUG] [1649321498.460382616]: motor_plugin(ns = //): <publish_encoder> = true

[DEBUG] [1649321498.460391414]: motor_plugin(ns = //): <publish_current> = true

[DEBUG] [1649321498.460414278]: motor_plugin(ns = //): <publish_motor_joint_state> = true

[ INFO] [1649321498.460672330]: motor_plugin(ns = //): Advertise joint_state

[ INFO] [1649321498.460683190]: motor_plugin(ns = //): Trying to subscribe to osl_knee/command

[ INFO] [1649321498.461942339]: motor_plugin(ns = //): Subscribed to osl_knee/command

[ INFO] [1649321498.461959966]: motor_plugin(ns = //): Trying to subscribe to osl_knee/supply_voltage

[ INFO] [1649321498.462839872]: motor_plugin(ns = //): Subscribed to osl_knee/command

[ INFO] [1649321498.463095982]: motor_plugin(ns = //): Advertising motor shaft (before gearbox) velocity on osl_knee/velocity 

[ INFO] [1649321498.465404916]: motor_plugin(ns = //): Advertising encoder counts on osl_knee/encoder 

[ INFO] [1649321498.465816275]: motor_plugin(ns = //): Advertising actual motor current on osl_knee/current 

[ INFO] [1649321498.465838156]: motor_plugin(ns = //): Setting up dynamic reconfigure server.

**[ERROR] [1649321498.465877614]: Tried to advertise a service that is already advertised in this node [/motor_plugin/set_parameters]**

[ INFO] [1649321498.469692678]: Notifying parameter server...

[ INFO] [1649321498.469713655]: DC Motor parameters validated and updated

[INFO] [1649321498.625820, 0.000000]: Controller Spawner: Waiting for service controller_manager/switch_controller

[INFO] [1649321498.627175, 0.000000]: Controller Spawner: Waiting for service controller_manager/unload_controller

[INFO] [1649321498.628285, 0.000000]: Loading controller: joint_state_controller

[INFO] [1649321498.632079, 0.000000]: Loading controller: hip_position_controller

[INFO] [1649321498.649398, 0.000000]: Loading controller: osl_hip_position_controller

[INFO] [1649321498.661972, 0.000000]: Loading controller: knee_position_controller

[INFO] [1649321498.674925, 0.000000]: Loading controller: ankle_position_controller

[INFO] [1649321498.687966, 0.000000]: Controller Spawner: Loaded controllers: joint_state_controller, hip_position_controller, osl_hip_position_controller, knee_position_controller, ankle_position_controller

Segmentation fault (core dumped)

**[gazebo_gui-3] process has died [pid 24292, exit code 139, cmd /opt/ros/melodic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/gazebo_gui-3.log].**

log file: /home/user/.ros/log/ee9d0af2-b64f-11ec-8165-30d042e761b4/gazebo_gui-3*.log

@Barath2908
Copy link

Facing the same error, was it resolved?

@avegetablechicken
Copy link
Author

Facing the same error, was it resolved?

No. Always the same error

@QiYue-day
Copy link

The first error occurred because in subsequent work, a robot_ns parameter was added to the 'oslsim.xacro' file in the 'oslsim' package, but this parameter was not added to the corresponding motor files, resulting in an error. I attempted to revert oslsim to a previous version (you can check when this parameter was added to avoid it), fortunately, the previous error disappeared. Unfortunately, there are new errors now.

@QiYue-day
Copy link

root@Qiyue:~/catkin_ws/src/oslsim# roslaunch oslsim main.launch control:=true
... logging to /root/.ros/log/aefbcd28-06d6-11ef-b9e5-00155d1306d2/roslaunch-Qiyue-16978.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
started roslaunch server http://Qiyue:43773/

SUMMARY

PARAMETERS

  • /gazebo/enable_ros_network: True
  • /oslsim/ankle_position_controller/joint: ankle
  • /oslsim/ankle_position_controller/pid/d: 0.01
  • /oslsim/ankle_position_controller/pid/i: 0.1
  • /oslsim/ankle_position_controller/pid/p: 10
  • /oslsim/ankle_position_controller/type: effort_controller...
  • /oslsim/hip_position_controller/joint: hip
  • /oslsim/hip_position_controller/pid/d: 0.01
  • /oslsim/hip_position_controller/pid/i: 0.1
  • /oslsim/hip_position_controller/pid/p: 10
  • /oslsim/hip_position_controller/type: effort_controller...
  • /oslsim/joint_state_controller/publish_rate: 50
  • /oslsim/joint_state_controller/type: joint_state_contr...
  • /oslsim/knee_position_controller/joint: knee
  • /oslsim/knee_position_controller/pid/d: 0.01
  • /oslsim/knee_position_controller/pid/i: 0.1
  • /oslsim/knee_position_controller/pid/p: 10
  • /oslsim/knee_position_controller/type: effort_controller...
  • /oslsim/osl_hip_position_controller/joint: osl_hip
  • /oslsim/osl_hip_position_controller/pid/d: 0.01
  • /oslsim/osl_hip_position_controller/pid/i: 0.1
  • /oslsim/osl_hip_position_controller/pid/p: 10
  • /oslsim/osl_hip_position_controller/type: effort_controller...
  • /robot_description: <?xml version="1....
  • /robot_state_publisher/ignore_timestamp: True
  • /robot_state_publisher/publish_frequency: 50.0
  • /robot_state_publisher/tf_prefix: oslsim
  • /rosdistro: melodic
  • /rosversion: 1.14.13
  • /use_sim_time: True

NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
loadcell (oslsim/loadcell.py)
oslsim_controller (oslsim/controller.py)
oslsim_walker (oslsim/walk.py)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
urdf_spawner (gazebo_ros/spawn_model)
/oslsim/
controller_spawner (controller_manager/spawner)

auto-starting new master
process[master]: started with pid [16995]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to aefbcd28-06d6-11ef-b9e5-00155d1306d2
process[rosout-1]: started with pid [17006]
started core service [/rosout]
process[gazebo-2]: started with pid [17009]
process[gazebo_gui-3]: started with pid [17013]
process[urdf_spawner-4]: started with pid [17017]
process[robot_state_publisher-5]: started with pid [17021]
process[oslsim/controller_spawner-6]: started with pid [17022]
process[loadcell-7]: started with pid [17026]
process[oslsim_walker-8]: started with pid [17027]
process[oslsim_controller-9]: started with pid [17028]
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
[INFO] [1714470460.782308, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[ INFO] [1714470460.796848062]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1714470460.799451539]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1714470460.813382649]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1714470460.814629139]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1714470461.025757358]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1714470461.036387422]: Physics dynamic reconfigure ready.
[urdf_spawner-4] process has finished cleanly
log file: /root/.ros/log/aefbcd28-06d6-11ef-b9e5-00155d1306d2/urdf_spawner-4*.log
Segmentation fault
[gazebo_gui-3] process has died [pid 17013, exit code 139, cmd /opt/ros/melodic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/root/.ros/log/aefbcd28-06d6-11ef-b9e5-00155d1306d2/gazebo_gui-3.log].
log file: /root/.ros/log/aefbcd28-06d6-11ef-b9e5-00155d1306d2/gazebo_gui-3*.log

@QiYue-day
Copy link

Rolling back my program seems to make it run, but when I open the interface, I encounter a similar issue as yours, and I can't find my log files. I haven't resolved this problem.

@QiYue-day
Copy link

I found that its osl_shank.dae file is incorrect. You can delete this file, and it seems it doesn't affect the normal operation of other components such as sensors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants