How to move a ball using ros controllers in Gazebo?
How to move a ball using ros-controllers in Gazebo?
Hello I have created a sphere urdf file i.e.,
<?xml version="1.0"?>
<robot name="target_point2_r2">
<!-- conveyor belt is just a long flat box for objects to slide on it -->
<!-- world link -->
<link name="world"/>
<!-- base_link and its fixed joint -->
<joint name="joint_fix" type="fixed">
<parent link="world"/>
<child link="base_link"/>
<axis xyz="1 0 0"/>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
</joint>
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<sphere radius="0.045"/>
</geometry>
</visual>
<!-- -0.229794383458 -->
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="1"/>
<inertia
ixx="1.0" ixy="0.0" ixz="0.0"
iyy="1.0" iyz="0.0"
izz="1.0"/>
</inertial>
</link>
<gazebo reference="base_link">
<transparency>0.9</transparency>
<mu1>2</mu1>
<mu2>2</mu2>
<material>Gazebo/Red</material>
<!-- <plugin name="plannar_mover_plugin" filename="libplannar_mover_plugin.so"/> -->
</gazebo>
<!-- ROS Control plugin for Gazebo -->
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>target_red</robotNamespace>
</plugin>
</gazebo>
<!-- transmission -->
<transmission name="target_red">
<type>transmission_interface/SimpleTransmission</type>
<actuator name="motor1">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
<joint name="joint_fix">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
</transmission>
</robot>
</robot>
I want to move it at different positions using ros controllers specifically joint trajectory controller. But I am not sure whether the urdf I have made is correct.
I have also made launch file and a target_controller.yaml file. But when I try to launch the launch file I get this error.,
Traceback (most recent call last):
File "/opt/ros/melodic/lib/gazebo_ros/spawn_model", line 232, in <module>
exit_code = sm.run()
File "/opt/ros/melodic/lib/gazebo_ros/spawn_model", line 146, in run
xml_parsed = xml.etree.ElementTree.fromstring(model_xml)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1311, in XML
parser.feed(text)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1657, in feed
self._parser.Parse(data, 0)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u202c' in position 603: ordinal not in range(128)
[spawn_gazebo_model-2] process has died [pid 2107, exit code 1, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -urdf -model target_red -param robot_description -z 0.805 __name:=spawn_gazebo_model __log:=/home/at-lab/.ros/log/6db6e4a6-2e31-11ea-b56e-64006a45f649/spawn_gazebo_model-2.log].
log file: /home/at-lab/.ros/log/6db6e4a6-2e31-11ea-b56e-64006a45f649/spawn_gazebo_model-2*.log
My launch file is,
<?xml version="1.0"?>
<launch>
<param name="robot_description" textfile="$(find target_desc)/urdf/target_point2_r2.urdf" />
<node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args=" -urdf -model
target_red -param robot_description -z 0.805" />
<!-- loads the controllers -->
<rosparam file="$(find target_desc)/config/target_controller.yaml" command="load" />
<node name="controller_spawner" pkg="controller_manager" type="spawner" ns="/target_red" args="target_red joint_state_controller"/>
<!-- converts joint states ...
Hello @mkb_10062949, I have the same problem but I am trying to move a rectangle. Have you found the solution? If so, could you please post it?