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

Add spawn flag for fullbody controller #128

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ros/kxr_controller/launch/kxr_controller.launch
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<arg name="temperature_limit" default="80" doc="Temperature limit in celsius" />
<arg name="read_current" default="false" />
<arg name="read_temperature" default="false" />
<arg name="spawn_fullbody_controller" default="true" doc="Internally spawn fullbody_controller" />

<group if="$(eval len(arg('namespace')) > 0)" ns="$(arg namespace)" >
<param name="control_loop_rate" value="$(arg control_loop_rate)" />
Expand Down Expand Up @@ -52,6 +53,7 @@
temperature_limit: $(arg temperature_limit)
read_current: $(arg read_current)
read_temperature: $(arg read_temperature)
spawn_fullbody_controller: $(arg spawn_fullbody_controller)
</rosparam>
</node>
<node name="urdf_model_server"
Expand Down Expand Up @@ -92,6 +94,7 @@
temperature_limit: $(arg temperature_limit)
read_current: $(arg read_current)
read_temperature: $(arg read_temperature)
spawn_fullbody_controller: $(arg spawn_fullbody_controller)
</rosparam>
</node>

Expand Down
2 changes: 2 additions & 0 deletions ros/kxr_controller/launch/kxr_controller_for_wheel.launch
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<arg name="temperature_limit" default="80" doc="Temperature limit in celsius" />
<arg name="read_current" default="false" />
<arg name="read_temperature" default="false" />
<arg name="spawn_fullbody_controller" default="true" doc="Internally spawn fullbody_controller" />

<include file="$(find kxr_controller)/launch/kxr_controller.launch" >
<arg name="urdf_path" value="$(arg urdf_path)" />
Expand All @@ -32,6 +33,7 @@
<arg name="temperature_limit" value="$(arg temperature_limit)" />
<arg name="read_current" value="$(arg read_current)" />
<arg name="read_temperature" value="$(arg read_temperature)" />
<arg name="spawn_fullbody_controller" value="$(arg spawn_fullbody_controller)" />
</include>

<group if="$(eval len(arg('namespace')) > 0)" ns="$(arg namespace)" >
Expand Down
19 changes: 11 additions & 8 deletions ros/kxr_controller/node_scripts/rcb4_ros_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def setup_paths_and_params(self):
self.joint_name_to_id, self.servo_infos = load_yaml(servo_config_path)
self.urdf_path = rospy.get_param("~urdf_path", None)
self.use_rcb4 = rospy.get_param("~use_rcb4", False)
self.spawn_fullbody_controller = rospy.get_param(
"~spawn_fullbody_controller", True)
self.control_pressure = rospy.get_param("~control_pressure", False)
self.read_temperature = rospy.get_param("~read_temperature", False) and not self.use_rcb4
self.read_current = rospy.get_param("~read_current", False) and not self.use_rcb4
Expand Down Expand Up @@ -419,14 +421,15 @@ def log_error_and_close_interface(function_name):
return True

def run_ros_robot_controllers(self):
self.proc_controller_spawner = subprocess.Popen(
[
f'/opt/ros/{os.environ["ROS_DISTRO"]}/bin/rosrun',
"controller_manager",
"spawner",
]
+ ["joint_state_controller", "fullbody_controller"]
)
if self.spawn_fullbody_controller:
self.proc_controller_spawner = subprocess.Popen(
[
f'/opt/ros/{os.environ["ROS_DISTRO"]}/bin/rosrun',
"controller_manager",
"spawner",
]
+ ["joint_state_controller", "fullbody_controller"]
)
self.proc_robot_state_publisher = run_robot_state_publisher(self.base_namespace)
self.proc_kxr_controller = run_kxr_controller(namespace=self.base_namespace)

Expand Down
Loading