rospy.get_param('~namespace') problem [closed]
I am trying to control a dynamixel ax-12 servo by using kinect.. I just use one servo I followed the tutorials in pi_robot package http://www.ros.org/wiki/openni/Contests/ROS%203D/Skeleton%20Tracker%20Teleoperation%20Package%20for%20Mobile%20Robot
When I start robotis.launch, it works fine.. But when i start dynamixels.launch to control my servo.. it has problems..
[WallTime: 1363352924.628046] /dev/ttyUSB0 controller_spawner: waiting for controller_manager None to startup in /ax12_controller/namespace...
Traceback (most recent call last): File "/home/rizqa/trunk2/pi_tracker/bin/controller_manager.py", line 251, in manager = ControllerManager()
File "/home/rizqa/trunk2/pi_tracker/bin/controller_manager.py", line 78, in __init__ manager_namespace = rospy.get_param('~namespace')
File "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/client.py", line 378, in get_param return _param_server[param_name] #MasterProxy does all the magic for usFile "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/msproxy.py",line 117, >in __getitem__ raise KeyError(key) KeyError: '~namespace'
I'm not sure why the controller_manager None to start up..
dynamixel.launch ( for a while, I just one servo )
<launch>
<param name="robot_description" command="cat $(find pi_tracker)/urdf/b_robot.urdf" />
<param name="/use_sim_time" value="False" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">
<param name="publish_frequency" value="50.0"/>
</node>
<!-- Define the namespace for all our controllers -->
<arg name="ax12_namespace" value="ax12_controller" />
<!-- Start the ax12 controller manager -->
<node ns="$(arg ax12_namespace)" name="ax12_manager" pkg="pi_tracker" type="controller_manager.py" required="true" output="screen">
<param name="port_name" type="str" value="/dev/ttyUSB0" />
<param name="baud_rate" type="int" value="1000000"/>
<param name="min_motor_id" type="int" value="1"/>
<param name="max_motor_id" type="int" value="1"/>
<param name="update_rate" type="int" value="10"/>
</node>
<!-- Load joint controller configuration to parameter server -->
<rosparam ns="$(arg ax12_namespace)" file="$(find pi_tracker)/params/dynamixels_params.yaml" command="load"/>
<!-- Start individual joint controllers -->
<node ns="$(arg ax12_namespace)" name="pi_tracker" pkg="pi_tracker" type="controller_spawner.py"
args="--port /dev/ttyUSB0
head_pan_controller"
output="screen" />
<!-- Start the ax12 joint state publisher -->
<node ns="$(arg ax12_namespace)" name="ax12_joint_state_publisher" pkg="pi_tracker" type="ax12_joint_state_publisher.py" output="screen">
<rosparam file="$(find pi_tracker)/params/dynamixels_params.yaml" command="load"/>
</node>
</launch>
How could this problem solved..?? thanks..
I have solved the problem..
Please state how you did this as an answer so others can benefit.
Same problem here. Sad that answer was not provided.
The reason why you are unable to read the ros param set under node is because, the name got changed i.e. attached with the name of node.
For example, if you consider the following <node name="testnode" pkg="asdf" type="a.py"> </node>
Then your parameter name will be /testnode/params. So now if you read using rospy.get_param(' /testnode/params'), you should be able to read it without any issue.