Skip to content

Instantly share code, notes, and snippets.

<launch>
<node pkg="my_beginner" type="talker" name="talker_test11" output="screen">
<remap from="/chatter" to="/re_name" />
</node>
<node pkg="my_beginner" type="listener" name="listener_test11" output="screen">
<remap from="/chatter" to="/re_name" />
</node>
<node pkg="turtlesim" type="turtlesim_node" name="turtle_graph" output="screen">
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
def move():
# Starts a new node
rospy.init_node('robot_cleaner', anonymous=True)
velocity_publisher = rospy.Publisher('/turtle1/cmd_vel', Twist, queue_size=10)
vel_msg = Twist()
<launch>
<node pkg="turtle_go" type="move.py" name="here_turtle" output="screen">
</node>
</launch>
<?xml version="1.0" encoding="big5" ?> <!-- 此為宣告 -->
<catalog> <!-- 此為root標籤的開始 -->
<product>
<pname>HP printer</pname> <!-- 標籤必須成對出現 -->
<price currency="NT">12000</price>
<mark /> <!-- 原來的寫法為 <mark></mark> -->
</product>
<hr />
<product>
<pname>IBM notebook</pname>
cd ~/catkin_ws/src
catkin_create_pkg MYROBOT_control controller_manager joint_state_controller robot_state_publisher
cd MYROBOT_control
mkdir config
mkdir launch
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find rrbot_control)/config/rrbot_control.yaml" command="load"/>
<!-- load the controllers -->
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
output="screen" ns="/rrbot" args="joint1_position_controller joint2_position_controller joint_state_controller"/>
<!-- convert joint states to TF transforms for rviz, etc -->
<!-- ros_control plugin -->
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/rrbot</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
<legacyModeNS>true</legacyModeNS>
</plugin>
</gazebo>
rostopic pub -1 /rrbot/joint1_position_controller/command std_msgs/Float64 "data: 1.5"
rostopic pub -1 /rrbot/joint2_position_controller/command std_msgs/Float64 "data: 1.0"
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/MYROBOT</robotNamespace>
</plugin>
</gazebo>
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/MYROBOT</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>