using html:link to pass a param

本文详细解释了HTML中linkaction标签的三个关键参数:paramName、paramProperty 和 paramId 的作用及用法。通过这些参数可以动态地为超链接添加请求参数。

<html:link action="/urAction.do" paramName="user" paramProperty="name" paramId="name">

paramName: The name of a JSP bean that is a String containing the value for the request parameter named by paramId (if paramProperty is not specified), or a JSP bean whose property getter is called to return a String (if paramProperty is specified). The JSP bean is constrained to the bean scope specified by the paramScope property, if it is specified. 对应javaBean的属性名。

paramProperty: The name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be dynamically added to this hyperlink. 保存在paramName的值,是真正要传的值。

paramId: The name of the request parameter that will be dynamically added to the generated hyperlink. The corresponding value is defined by the paramName and (optional) paramProperty attributes, optionally scoped by the paramScope attribute 存在request当中的变量名,他的值是名字是paramName的值:paramProperty 。

<?xml version="1.0" ?> <!-- =================================================================================== --> <!-- | This document was autogenerated by xacro from src/kuka_kr10_support/urdf/kr10r1420.xacro | --> <!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | --> <!-- =================================================================================== --> <robot name="kuka_kr10r1420"> <!-- colours based on RAL values given in "FAQ - Colours of robot and robot controller", version "KUKA.Tifs | 2010-01-21 |YM| DefaultColorsRobotAndController.doc", downloaded 2015-07-18 from http://www.kuka.be/main/cservice/faqs/hardware/DefaultColorsRobotAndController.pdf all RAL colours converted using http://www.visual-graphics.de/en/customer-care/ral-colours --> <!-- 机器人的身体部分 --> <link name="base_link"> <!-- 部件外观描述 --> <visual> <!-- 沿着自己几何中心的偏移和旋转 --> <origin rpy="0 0 0" xyz="0 0 0"/> <!-- 几何形状 --> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/visual/base_link.stl"/> </geometry> <material name="kuka_black"> <color rgba="0.054901960784313725 0.054901960784313725 0.06274509803921569 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/collision/base_link.stl"/> </geometry> </collision> <inertial> <mass value="100.0"/> <origin rpy="0 0 0" xyz="0 0 0.145"/> <inertia ixx="1.401041666666667" ixy="0.0" ixz="0.0" iyy="1.401041666666667" iyz="0.0" izz="1.760416666666667"/> </inertial> </link> <link name="link_1"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/visual/link_1.stl"/> </geometry> <material name="kuka_orange"> <color rgba="0.9647058823529412 0.47058823529411764 0.1568627450980392 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/collision/link_1.stl"/> </geometry> </collision> <inertial> <mass value="60.0"/> <origin rpy="0 0 0" xyz="0 0 -0.02"/> <inertia ixx="1.1244999999999998" ixy="0.0" ixz="0.0" iyy="1.4125" iyz="0.0" izz="1.312"/> </inertial> </link> <link name="link_2"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/visual/link_2.stl"/> </geometry> <material name="kuka_orange"> <color rgba="0.9647058823529412 0.47058823529411764 0.1568627450980392 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/collision/link_2.stl"/> </geometry> </collision> <inertial> <mass value="18.0"/> <origin rpy="0 0 0" xyz="0.335 -0.17 0"/> <inertia ixx="0.0675" ixy="0.0" ixz="0.0" iyy="0.7071000000000002" iyz="0.0" izz="0.7071000000000002"/> </inertial> </link> <link name="link_3"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/visual/link_3.stl"/> </geometry> <material name="kuka_orange"> <color rgba="0.9647058823529412 0.47058823529411764 0.1568627450980392 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/collision/link_3.stl"/> </geometry> </collision> <inertial> <mass value="15.0"/> <origin rpy="0 0 0" xyz="0.14 0 0.01"/> <inertia ixx="0.04225" ixy="0.0" ixz="0.0" iyy="0.24162499999999998" iyz="0.0" izz="0.24162499999999998"/> </inertial> </link> <link name="link_4"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/visual/link_4.stl"/> </geometry> <material name="kuka_orange"> <color rgba="0.9647058823529412 0.47058823529411764 0.1568627450980392 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/collision/link_4.stl"/> </geometry> </collision> <inertial> <mass value="15.0"/> <origin rpy="0 0 0" xyz="0.52 0 0.01"/> <inertia ixx="0.04225" ixy="0.0" ixz="0.0" iyy="0.17425" iyz="0.0" izz="0.17425"/> </inertial> </link> <link name="link_5"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/visual/link_5.stl"/> </geometry> <material name="kuka_orange"> <color rgba="0.9647058823529412 0.47058823529411764 0.1568627450980392 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/collision/link_5.stl"/> </geometry> </collision> <inertial> <mass value="5.0"/> <origin rpy="0 0 0" xyz="0.02 0 0"/> <inertia ixx="0.005333333333333334" ixy="0.0" ixz="0.0" iyy="0.0077083333333333335" iyz="0.0" izz="0.0077083333333333335"/> </inertial> </link> <link name="link_6"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/visual/link_6.stl"/> </geometry> <material name="kuka_pedestal"> <color rgba="0.5058823529411764 0.47058823529411764 0.38823529411764707 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://kuka_kr10_support/meshes/kr10r1420/collision/link_6.stl"/> </geometry> </collision> <inertial> <mass value="1.0"/> <origin rpy="0 0 0" xyz="-0.007 0 0"/> <inertia ixx="0.0002666666666666667" ixy="0.0" ixz="0.0" iyy="0.00014741666666666668" iyz="0.0" izz="0.00014741666666666668"/> </inertial> </link> <link name="flange"/> <link name="tool0"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <cylinder length="0.02" radius="0.03"/> </geometry> </visual> <collision name="tool0_collision"> <!-- 注意 collision 名称必须与插件中一致 --> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <cylinder length="0.02" radius="0.03"/> </geometry> <material name="kuka_black"> <color rgba="0.054901960784313725 0.054901960784313725 0.06274509803921569 1.0"/> </material> </collision> </link> <!-- 按照机器人工程实践标准 199(REP199),该框架应用于连接末端执行器(EEF)或其他设备 --> <joint name="joint_1" type="revolute"> <origin rpy="0 0 0" xyz="0 0 0.450"/> <parent link="base_link"/> <child link="link_1"/> <axis xyz="0 0 -1"/> <limit effort="0" lower="-2.9670597283903604" upper="2.9670597283903604" velocity="3.839724354387525"/> </joint> <joint name="joint_2" type="revolute"> <origin rpy="0 0 0" xyz="0.150 0 0"/> <parent link="link_1"/> <child link="link_2"/> <axis xyz="0 1 0"/> <limit effort="0" lower="-3.2288591161895095" upper="1.1344640137963142" velocity="3.6651914291880923"/> </joint> <joint name="joint_3" type="revolute"> <origin rpy="0 0 0" xyz="0.610 0 0"/> <parent link="link_2"/> <child link="link_3"/> <axis xyz="0 1 0"/> <limit effort="0" lower="-2.3911010752322315" upper="2.8448866807507573" velocity="4.71238898038469"/> </joint> <joint name="joint_4" type="revolute"> <origin rpy="0 0 0" xyz="0 0 0.02"/> <parent link="link_3"/> <child link="link_4"/> <axis xyz="-1 0 0"/> <limit effort="0" lower="-3.2288591161895095" upper="3.2288591161895095" velocity="6.649704450098396"/> </joint> <joint name="joint_5" type="revolute"> <origin rpy="0 0 0" xyz="0.660 0 0"/> <parent link="link_4"/> <child link="link_5"/> <axis xyz="0 1 0"/> <limit effort="0" lower="-2.0943951023931953" upper="2.0943951023931953" velocity="5.427973973702365"/> </joint> <joint name="joint_6" type="revolute"> <origin rpy="0 0 0" xyz="0.080 0 0"/> <parent link="link_5"/> <child link="link_6"/> <axis xyz="-1 0 0"/> <limit effort="0" lower="-6.1086523819801535" upper="6.1086523819801535" velocity="8.587019919812102"/> </joint> <joint name="joint_6-flange" type="fixed"> <parent link="link_6"/> <child link="flange"/> <origin rpy="0 0 0" xyz="0 0 0"/> </joint> <joint name="flange_tool0" type="fixed"> <parent link="flange"/> <child link="tool0"/> <origin rpy="0 1.5707963267948966 0" xyz="0.05 0 0"/> <!-- 吸盘位于 flange 末端 5cm 处 --> </joint> <!-- ROS(机器人操作系统)中的 “base_link” 坐标系到库卡(KUKA)机器人的 “$ROBROOT” 坐标系的变换 --> <link name="base"/> <joint name="base_link-base" type="fixed"> <origin rpy="0 0 0" xyz="0 0 0"/> <parent link="base_link"/> <child link="base"/> </joint> <link name="world"/> <joint name="base-world" type="fixed"> <origin rpy="0 0 0" xyz="0 0 0"/> <parent link="world"/> <child link="base_link"/> </joint> <gazebo reference="base_link"> <material>Gazebo/Black</material> </gazebo> <!-- Base --> <gazebo reference="base_link"> <!-- 接触刚度系数 --> <kp>1000000.0</kp> <!-- 阻尼系数 --> <kd>100.0</kd> <!-- 切向摩擦系数 --> <mu1>30.0</mu1> <!-- 法向摩擦系数 --> <mu2>30.0</mu2> <maxVel>1.0</maxVel> <minDepth>0.001</minDepth> </gazebo> <!-- Link1 --> <gazebo reference="link_1"> <kp>1000000.0</kp> <kd>100.0</kd> <mu1>30.0</mu1> <mu2>30.0</mu2> <maxVel>1.0</maxVel> <minDepth>0.001</minDepth> </gazebo> <!-- Link2 --> <gazebo reference="link_2"> <kp>1000000.0</kp> <kd>100.0</kd> <mu1>30.0</mu1> <mu2>30.0</mu2> <maxVel>1.0</maxVel> <minDepth>0.001</minDepth> </gazebo> <!-- Link3 --> <gazebo reference="link_3"> <kp>1000000.0</kp> <kd>100.0</kd> <mu1>30.0</mu1> <mu2>30.0</mu2> <maxVel>1.0</maxVel> <minDepth>0.001</minDepth> </gazebo> <!-- Link4 --> <gazebo reference="link_4"> <kp>1000000.0</kp> <kd>100.0</kd> <mu1>30.0</mu1> <mu2>30.0</mu2> <maxVel>1.0</maxVel> <minDepth>0.001</minDepth> </gazebo> <!-- Link5 --> <gazebo reference="link_5"> <kp>1000000.0</kp> <kd>100.0</kd> <mu1>30.0</mu1> <mu2>30.0</mu2> <maxVel>1.0</maxVel> <minDepth>0.001</minDepth> </gazebo> <!-- Link6 --> <gazebo reference="link_6"> <kp>1000000.0</kp> <kd>100.0</kd> <mu1>30.0</mu1> <mu2>30.0</mu2> <maxVel>1.0</maxVel> <minDepth>0.001</minDepth> </gazebo> <gazebo> <plugin filename="libgazebo_ros_vacuum_gripper.so" name="vacuum_gripper"> <ros> <namespace>/vacuum_gripper</namespace> </ros> <!-- 吸附作用在 tool0 的碰撞体 --> <link_name>tool0</link_name> <!-- 吸附参数优化 --> <min_distance>0.1</min_distance> <!-- 物体距离小于此值时触发吸附 --> <max_distance>0.2</max_distance> <!-- 超过此距离则释放物体 --> <attach_force>100</attach_force> <!-- 施加的最大吸附力 --> <detach_force>-100</detach_force> <!-- 施加的脱离力 --> <!-- 排除固定物体 --> <fixed>ground_plane</fixed> <fixed>wall</fixed> </plugin> </gazebo> <!-- colours based on RAL values given in "FAQ - Colours of robot and robot controller", version "KUKA.Tifs | 2010-01-21 |YM| DefaultColorsRobotAndController.doc", downloaded 2015-07-18 from http://www.kuka.be/main/cservice/faqs/hardware/DefaultColorsRobotAndController.pdf all RAL colours converted using http://www.visual-graphics.de/en/customer-care/ral-colours --> <!--相机支撑杆--> <link name="camera_cylinder_link"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <cylinder length="1.0" radius="0.02"/> </geometry> <material name="kuka_black"> <color rgba="0.054901960784313725 0.054901960784313725 0.06274509803921569 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0.0"/> <geometry> <box size="0.02 0.10 0.02"/> </geometry> <material name="black"> <color rgba="0.0 0.0 0.0 0.8"/> </material> </collision> <inertial> <mass value="2.0"/> <origin rpy="0 0 0" xyz="1.5 1.5 0.5"/> <inertia ixx="0.16673333333333332" ixy="0.0" ixz="0.0" iyy="0.16673333333333332" iyz="0.0" izz="0.00013333333333333334"/> </inertial> </link> <!-- ============相机模块================ --> <link name="camera_link"> <visual> <origin rpy="0 0 1.5707963267948966" xyz="0 0 0"/> <geometry> <box size="0.1 0.02 0.02"/> </geometry> <material name="kuka_black"> <color rgba="0.054901960784313725 0.054901960784313725 0.06274509803921569 1.0"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0.0"/> <geometry> <box size="0.1 0.02 0.02"/> </geometry> <material name="black"> <color rgba="0.0 0.0 0.0 0.8"/> </material> </collision> <inertial> <mass value="0.5"/> <origin rpy="0 0 0" xyz="1.5 1.5 1.01"/> <inertia ixx="3.3333333333333335e-05" ixy="0.0" ixz="0.0" iyy="0.00043333333333333337" iyz="0.0" izz="0.00043333333333333337"/> </inertial> </link> <link name="camera_optical_link"/> <joint name="camera_optical_joint" type="fixed"> <parent link="camera_link"/> <child link="camera_optical_link"/> <!-- 蓝色z轴 绿色y轴 红色x轴 控制点云图旋转--> <origin rpy="-1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0"/> </joint> <joint name="camera_joint" type="fixed"> <parent link="camera_cylinder_link"/> <child link="camera_link"/> <!-- 控制相机视角 --> <origin rpy="0 0.5235987755982988 -2.356194490192345" xyz="0 0 0.51"/> </joint> <joint name="camera_cylinder_joint" type="fixed"> <parent link="world"/> <child link="camera_cylinder_link"/> <origin rpy="0 0 0" xyz="1.5 1.5 0.5"/> </joint> <gazebo reference="camera_cylinder_link"> <material>Gazebo/Black</material> </gazebo> <gazebo reference="camera_link"> <material>Gazebo/Black</material> </gazebo> <gazebo reference="camera_link"> <sensor name="camera_sensor" type="depth"> <plugin filename="libgazebo_ros_camera.so" name="depth_camera"> <frame_name>camera_optical_link</frame_name> </plugin> <always_on>true</always_on> <update_rate>10</update_rate> <camera name="camera"> <horizontal_fov>1.5009831567</horizontal_fov> <image> <width>800</width> <height>600</height> <format>R8G8B8</format> </image> <distortion> <k1>0.0</k1> <k2>0.0</k2> <k3>0.0</k3> <p1>0.0</p1> <p2>0.0</p2> <center>0.5 0.5</center> </distortion> </camera> </sensor> </gazebo> <gazebo> <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control"> <robot_param>robot_description</robot_param> <robot_param_node>robot_state_publisher</robot_param_node> <parameters>/home/honey/dev_ws/install/kuka_kr10_support/share/kuka_kr10_support/config/kr10r1420_controller.yaml</parameters> </plugin> </gazebo> <ros2_control name="GazeboSystem" type="system"> <hardware> <plugin>gazebo_ros2_control/GazeboSystem</plugin> </hardware> <joint name="joint_1"> <command_interface name="position"> <param name="min">-6.2832</param> <param name="max">6.2832</param> </command_interface> <state_interface name="position"/> <state_interface name="velocity"/> <state_interface name="effort"/> </joint> <joint name="joint_2"> <command_interface name="position"> <param name="min">-6.2832</param> <param name="max">6.2832</param> </command_interface> <state_interface name="position"/> <state_interface name="velocity"/> <state_interface name="effort"/> </joint> <joint name="joint_3"> <command_interface name="position"> <param name="min">-2.7925</param> <param name="max">2.7925</param> </command_interface> <state_interface name="position"/> <state_interface name="velocity"/> <state_interface name="effort"/> </joint> <joint name="joint_4"> <command_interface name="position"> <param name="min">-6.2832</param> <param name="max">6.2832</param> </command_interface> <state_interface name="position"/> <state_interface name="velocity"/> <state_interface name="effort"/> </joint> <joint name="joint_5"> <command_interface name="position"> <param name="min">-6.2832</param> <param name="max">6.2832</param> </command_interface> <state_interface name="position"/> <state_interface name="velocity"/> <state_interface name="effort"/> </joint> <joint name="joint_6"> <command_interface name="position"> <param name="min">-6.2832</param> <param name="max">6.2832</param> </command_interface> <state_interface name="position"/> <state_interface name="velocity"/> <state_interface name="effort"/> </joint> </ros2_control> <transmission name="transmission_1" role="actuator1"> <plugin>transmission_interface/SimpleTransmission</plugin> <actuator name="motor_1" role="actuator1"/> <joint name="joint_1" role="joint1"> <mechanicalReduction>1.0</mechanicalReduction> </joint> </transmission> <transmission name="transmission_2" role="actuator1"> <plugin>transmission_interface/SimpleTransmission</plugin> <actuator name="motor_2" role="actuator1"/> <joint name="joint_2" role="joint1"> <mechanicalReduction>1.0</mechanicalReduction> </joint> </transmission> <transmission name="transmission_3" role="actuator1"> <plugin>transmission_interface/SimpleTransmission</plugin> <actuator name="motor_3" role="actuator1"/> <joint name="joint_3" role="joint1"> <mechanicalReduction>1.0</mechanicalReduction> </joint> </transmission> <transmission name="transmission_4" role="actuator1"> <plugin>transmission_interface/SimpleTransmission</plugin> <actuator name="motor_4" role="actuator1"/> <joint name="joint_4" role="joint1"> <mechanicalReduction>1.0</mechanicalReduction> </joint> </transmission> <transmission name="transmission_5" role="actuator1"> <plugin>transmission_interface/SimpleTransmission</plugin> <actuator name="motor_5" role="actuator1"/> <joint name="joint_5" role="joint1"> <mechanicalReduction>1.0</mechanicalReduction> </joint> </transmission> <transmission name="transmission_6" role="actuator1"> <plugin>transmission_interface/SimpleTransmission</plugin> <actuator name="motor_6" role="actuator1"/> <joint name="joint_6" role="joint1"> <mechanicalReduction>1.0</mechanicalReduction> </joint> </transmission> </robot> 以上为urdf,以下为gripper.py import rclpy from std_msgs.msg import Bool def main(args=None): rclpy.init(args=args) node = rclpy.create_node('vacuum_gripper_control') activate_publisher = node.create_publisher(Bool, '/vacuum_gripper/activate', 10) deactivate_publisher = node.create_publisher(Bool, '/vacuum_gripper/deactivate', 10) msg_activate = Bool() msg_deactivate = Bool() msg_activate.data = True msg_deactivate.data = False try: while rclpy.ok(): user_input = input("Enter 'a' to activate or 'd' to deactivate the gripper: ") if user_input == 'a': activate_publisher.publish(msg_activate) node.get_logger().info("Vacuum Gripper Activated!") elif user_input == 'd': deactivate_publisher.publish(msg_deactivate) node.get_logger().info("Vacuum Gripper Deactivated!") except KeyboardInterrupt: pass if __name__ == '__main__': main() 为什么我启动这个.py文件机械臂末端执行器不吸取物块。 若解决这个问题你还需要其他什么文件告诉我,我告诉你
最新发布
05-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值