Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 9

Comment by moshahin for I am building my own 4WD model and I am trying to implement 4 velocity controllers (one for each motor). The issue arises when I execute my launch file (which contains the controller_spawner node), the transforms between the base_link and the 4 wheels are non-existent. I have tried the joint_state_publisher node with the GUI (instead of the controller_spawner) and it works. However when I implement the controller_spawner node, the transforms disappear. I have made sure to download all necessary packages for ros_control. I have used the ros_control plugin in my URDF and even made sure the namespaces are all correct in the YAML, URDF and launch file. Every time I execute the launch file, I get the error: "Controller Spawner couldn't find the expected controller_manager ROS interface."Then I get the error within Rviz that there are no transforms between the base_link and the wheels. When I run rospack list | grep control I get: control_msgs /opt/ros/melodic/share/control_msgs control_toolbox /opt/ros/melodic/share/control_toolbox controller_interface /opt/ros/melodic/share/controller_interface controller_manager /opt/ros/melodic/share/controller_manager controller_manager_msgs /opt/ros/melodic/share/controller_manager_msgs diff_drive_controller /opt/ros/melodic/share/diff_drive_controller effort_controllers /opt/ros/melodic/share/effort_controllers force_torque_sensor_controller /opt/ros/melodic/share/force_torque_sensor_controller forward_command_controller /opt/ros/melodic/share/forward_command_controller gazebo_ros_control /opt/ros/melodic/share/gazebo_ros_control gripper_action_controller /opt/ros/melodic/share/gripper_action_controller imu_sensor_controller /opt/ros/melodic/share/imu_sensor_controller joint_state_controller /opt/ros/melodic/share/joint_state_controller joint_trajectory_controller /opt/ros/melodic/share/joint_trajectory_controller position_controllers /opt/ros/melodic/share/position_controllers velocity_controllers /opt/ros/melodic/share/velocity_controllers My launch file is: <launch> <!--Load the URDF file --> <param name="robot_description" command="cat $(find monsterborg_description)/urdf/monsterborg.urdf"/> <!-- Launch the robot_state_publisher to broadcast transforms to '/tf' --> <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen"> <!-- remap from="/joint_states" to="/monsterborg/joint_states"/--> </node> <!-- Load the configuration of the joint controllers --> <rosparam file='$(find monsterborg_description)/config/monsterborg_controllers.yaml' command='load'/> <!-- Load the joint controllers --> <node name='controller_spawner' pkg='controller_manager' type='spawner' respawn='false' output='screen' ns='/monsterborg' args='rf_wheel_velocity_controller rb_wheel_velocity_controller lf_wheel_velocity_controller lb_wheel_velocity_controller joint_state_controller'/> <!-- Loads the 'world' static frame --> <node pkg='tf' type='static_transform_publisher' name='world_frame' args='0 0 0 0 0 0 /world /base_link 100'/> <!-- Open Rviz with specific configuration --> <node name="rviz" pkg="rviz" type="rviz" args="-d $(find monsterborg_description)/rviz_config/monsterborg.rviz"/> </launch> My YAML: monsterborg: joint_state_controller: type: joint_state_controller/JointStateController publish_rate: 50 rf_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_rf_wheel pid: {p: 1.0, i: 1.0, d: 1.0} lf_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_lf_wheel pid: {p: 1.0, i: 1.0, d: 1.0} rb_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_rb_wheel pid: {p: 1.0, i: 1.0, d: 1.0} lb_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_lb_wheel pid: {p: 1.0, i: 1.0, d: 1.0} Here is a small snippet of the URDF file for the base_link, one wheel and motor: <robot name="monsterborg"><link name="base_link"> <visual> <origin xyz="0 0 0 ...(more)

Next: Comment by Weasfas for I am building my own 4WD model and I am trying to implement 4 velocity controllers (one for each motor). The issue arises when I execute my launch file (which contains the controller_spawner node), the transforms between the base_link and the 4 wheels are non-existent. I have tried the joint_state_publisher node with the GUI (instead of the controller_spawner) and it works. However when I implement the controller_spawner node, the transforms disappear. I have made sure to download all necessary packages for ros_control. I have used the ros_control plugin in my URDF and even made sure the namespaces are all correct in the YAML, URDF and launch file. Every time I execute the launch file, I get the error: "Controller Spawner couldn't find the expected controller_manager ROS interface."Then I get the error within Rviz that there are no transforms between the base_link and the wheels. When I run rospack list | grep control I get: control_msgs /opt/ros/melodic/share/control_msgs control_toolbox /opt/ros/melodic/share/control_toolbox controller_interface /opt/ros/melodic/share/controller_interface controller_manager /opt/ros/melodic/share/controller_manager controller_manager_msgs /opt/ros/melodic/share/controller_manager_msgs diff_drive_controller /opt/ros/melodic/share/diff_drive_controller effort_controllers /opt/ros/melodic/share/effort_controllers force_torque_sensor_controller /opt/ros/melodic/share/force_torque_sensor_controller forward_command_controller /opt/ros/melodic/share/forward_command_controller gazebo_ros_control /opt/ros/melodic/share/gazebo_ros_control gripper_action_controller /opt/ros/melodic/share/gripper_action_controller imu_sensor_controller /opt/ros/melodic/share/imu_sensor_controller joint_state_controller /opt/ros/melodic/share/joint_state_controller joint_trajectory_controller /opt/ros/melodic/share/joint_trajectory_controller position_controllers /opt/ros/melodic/share/position_controllers velocity_controllers /opt/ros/melodic/share/velocity_controllers My launch file is: <launch> <!--Load the URDF file --> <param name="robot_description" command="cat $(find monsterborg_description)/urdf/monsterborg.urdf"/> <!-- Launch the robot_state_publisher to broadcast transforms to '/tf' --> <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen"> <!-- remap from="/joint_states" to="/monsterborg/joint_states"/--> </node> <!-- Load the configuration of the joint controllers --> <rosparam file='$(find monsterborg_description)/config/monsterborg_controllers.yaml' command='load'/> <!-- Load the joint controllers --> <node name='controller_spawner' pkg='controller_manager' type='spawner' respawn='false' output='screen' ns='/monsterborg' args='rf_wheel_velocity_controller rb_wheel_velocity_controller lf_wheel_velocity_controller lb_wheel_velocity_controller joint_state_controller'/> <!-- Loads the 'world' static frame --> <node pkg='tf' type='static_transform_publisher' name='world_frame' args='0 0 0 0 0 0 /world /base_link 100'/> <!-- Open Rviz with specific configuration --> <node name="rviz" pkg="rviz" type="rviz" args="-d $(find monsterborg_description)/rviz_config/monsterborg.rviz"/> </launch> My YAML: monsterborg: joint_state_controller: type: joint_state_controller/JointStateController publish_rate: 50 rf_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_rf_wheel pid: {p: 1.0, i: 1.0, d: 1.0} lf_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_lf_wheel pid: {p: 1.0, i: 1.0, d: 1.0} rb_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_rb_wheel pid: {p: 1.0, i: 1.0, d: 1.0} lb_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_lb_wheel pid: {p: 1.0, i: 1.0, d: 1.0} Here is a small snippet of the URDF file for the base_link, one wheel and motor: <robot name="monsterborg"><link name="base_link"> <visual> <origin xyz="0 0 0 ...(more)
Previous: Comment by Weasfas for I am building my own 4WD model and I am trying to implement 4 velocity controllers (one for each motor). The issue arises when I execute my launch file (which contains the controller_spawner node), the transforms between the base_link and the 4 wheels are non-existent. I have tried the joint_state_publisher node with the GUI (instead of the controller_spawner) and it works. However when I implement the controller_spawner node, the transforms disappear. I have made sure to download all necessary packages for ros_control. I have used the ros_control plugin in my URDF and even made sure the namespaces are all correct in the YAML, URDF and launch file. Every time I execute the launch file, I get the error: "Controller Spawner couldn't find the expected controller_manager ROS interface."Then I get the error within Rviz that there are no transforms between the base_link and the wheels. When I run rospack list | grep control I get: control_msgs /opt/ros/melodic/share/control_msgs control_toolbox /opt/ros/melodic/share/control_toolbox controller_interface /opt/ros/melodic/share/controller_interface controller_manager /opt/ros/melodic/share/controller_manager controller_manager_msgs /opt/ros/melodic/share/controller_manager_msgs diff_drive_controller /opt/ros/melodic/share/diff_drive_controller effort_controllers /opt/ros/melodic/share/effort_controllers force_torque_sensor_controller /opt/ros/melodic/share/force_torque_sensor_controller forward_command_controller /opt/ros/melodic/share/forward_command_controller gazebo_ros_control /opt/ros/melodic/share/gazebo_ros_control gripper_action_controller /opt/ros/melodic/share/gripper_action_controller imu_sensor_controller /opt/ros/melodic/share/imu_sensor_controller joint_state_controller /opt/ros/melodic/share/joint_state_controller joint_trajectory_controller /opt/ros/melodic/share/joint_trajectory_controller position_controllers /opt/ros/melodic/share/position_controllers velocity_controllers /opt/ros/melodic/share/velocity_controllers My launch file is: <launch> <!--Load the URDF file --> <param name="robot_description" command="cat $(find monsterborg_description)/urdf/monsterborg.urdf"/> <!-- Launch the robot_state_publisher to broadcast transforms to '/tf' --> <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen"> <!-- remap from="/joint_states" to="/monsterborg/joint_states"/--> </node> <!-- Load the configuration of the joint controllers --> <rosparam file='$(find monsterborg_description)/config/monsterborg_controllers.yaml' command='load'/> <!-- Load the joint controllers --> <node name='controller_spawner' pkg='controller_manager' type='spawner' respawn='false' output='screen' ns='/monsterborg' args='rf_wheel_velocity_controller rb_wheel_velocity_controller lf_wheel_velocity_controller lb_wheel_velocity_controller joint_state_controller'/> <!-- Loads the 'world' static frame --> <node pkg='tf' type='static_transform_publisher' name='world_frame' args='0 0 0 0 0 0 /world /base_link 100'/> <!-- Open Rviz with specific configuration --> <node name="rviz" pkg="rviz" type="rviz" args="-d $(find monsterborg_description)/rviz_config/monsterborg.rviz"/> </launch> My YAML: monsterborg: joint_state_controller: type: joint_state_controller/JointStateController publish_rate: 50 rf_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_rf_wheel pid: {p: 1.0, i: 1.0, d: 1.0} lf_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_lf_wheel pid: {p: 1.0, i: 1.0, d: 1.0} rb_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_rb_wheel pid: {p: 1.0, i: 1.0, d: 1.0} lb_wheel_velocity_controller: type: effort_controllers/JointVelocityController joint: base_to_lb_wheel pid: {p: 1.0, i: 1.0, d: 1.0} Here is a small snippet of the URDF file for the base_link, one wheel and motor: <robot name="monsterborg"><link name="base_link"> <visual> <origin xyz="0 0 0 ...(more)
$
0
0
@Weasfas I figured out why the `tf_tree` was broken. I wasn't aware that the gazebo node published to the topic `/monsterborg/joint_states` and the whole time the `robot_state_publisher` node was subscribing to the topic `/joint_states`. All I had to do was uncomment the remapping in the launch file,`remap from="/joint_states" to="/monsterborg/joint_states` ,which I originally commented as I thought it was only a remapping done for convenience rather then necessity. Now the model is simulated in both Rviz and Gazebo however, the model moves around in Gazebo while in Rviz it moves on the spot. The coordinate frames of the wheels are moving in Rviz but the model itself is stationary (If that makes sense). I'm going to try figure out how to simulate complete movement from Gazebo to Rviz as I need that for navigation purposes. Once again thank you for your help!

Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>