Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Elevators in ipa-apartment and object QRCode #4

Merged
merged 4 commits into from about 2 years ago

2 participants

Nadia Hammoudeh García Florian Weisshardt
This page is out of date. Refresh to see the latest.
5 cob_gazebo_objects/config/ipa-apartment/object_locations.yaml
@@ -63,3 +63,8 @@ couch:
63 63 position: [3.6,0.6,0]
64 64 orientation: [0, 0,-1.57079]
65 65
  66 +QRCode:
  67 + model_type: urdf.xacro
  68 + position: [-1.34,-1.7,2]
  69 + orientation: [0,0,0]
  70 +
69 cob_gazebo_objects/objects/QRCode.urdf.xacro
... ... @@ -0,0 +1,69 @@
  1 +<?xml version="1.0"?>
  2 +<robot name="QRCode"
  3 + xmlns:xi="http://www.w3.org/2001/XInclude"
  4 + xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"
  5 + xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"
  6 + xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
  7 + xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"
  8 + xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"
  9 + xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"
  10 + xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
  11 + xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering"
  12 + xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable"
  13 + xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
  14 + xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics"
  15 +>
  16 +
  17 +
  18 +<!-- dummy_link -->
  19 + <link name="dummy_link">
  20 + <inertial>
  21 + <origin xyz="0 0 0" />
  22 + <mass value="5.0" />
  23 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  24 + </inertial>
  25 + <visual>
  26 + <origin xyz="0 0 0" />
  27 + <geometry>
  28 + <box size="0.00 0.00 0.00" />
  29 + </geometry>
  30 + </visual>
  31 + <collision>
  32 + <origin xyz="0 0 0" />
  33 + <geometry>
  34 + <box size="0.00 0.00 0.00" />
  35 + </geometry>
  36 + </collision>
  37 + </link>
  38 +
  39 + <link name="QRCode">
  40 + <inertial>
  41 + <origin xyz="0 0 0" />
  42 + <mass value="5.0" />
  43 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  44 + </inertial>
  45 + <visual>
  46 + <origin xyz="0 0 0" />
  47 + <geometry>
  48 + <box size="0.01 0.2 0.2" />
  49 + </geometry>
  50 + </visual>
  51 + <collision>
  52 + <origin xyz="0 0 0" />
  53 + <geometry>
  54 + <box size="0.01 0.1 2.5" />
  55 + </geometry>
  56 + </collision>
  57 + </link>
  58 +
  59 + <gazebo reference="QRCode">
  60 + <material>IPA/QRCode</material>
  61 + </gazebo>
  62 +
  63 + <joint name="joint_QRCode" type="fixed">
  64 + <origin xyz="0 0 0" rpy="0 0 0" />
  65 + <parent link="dummy_link" />
  66 + <child link="QRCode" />
  67 + </joint>
  68 +
  69 +</robot>
14 cob_gazebo_worlds/Media/materials/scripts/ipa.material
@@ -28,6 +28,20 @@ material IPA/Care-O-bot
28 28 }
29 29 }
30 30
  31 +material IPA/QRCode
  32 +{
  33 + technique
  34 + {
  35 + pass
  36 + {
  37 + texture_unit
  38 + {
  39 + texture QRCode.png
  40 + }
  41 + }
  42 + }
  43 +}
  44 +
31 45 material IPA/Future
32 46 {
33 47 technique
BIN  cob_gazebo_worlds/Media/materials/textures/QRCode.png
505 cob_gazebo_worlds/common/worlds/ipa-apartment.urdf.xacro
@@ -408,6 +408,511 @@ Setting pose: 1.969 -4.262 0.087
408 408 <child link="door_01" />
409 409 </joint>
410 410
  411 + <!-- wall ext -->
  412 + <link name="wall_ext">
  413 + <inertial>
  414 + <origin xyz="0 0 0" />
  415 + <mass value="5.0" />
  416 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  417 + </inertial>
  418 + <visual>
  419 + <origin xyz="0 0 0" />
  420 + <geometry>
  421 + <box size="4.6 0.04 ${size_z_wall1}" />
  422 + </geometry>
  423 + </visual>
  424 + <collision>
  425 + <origin xyz="0 0 0" />
  426 + <geometry>
  427 + <box size="4.6 0.04 ${size_z_wall1}" />
  428 + </geometry>
  429 + </collision>
  430 + </link>
  431 +
  432 + <gazebo reference="wall_ext">
  433 + <material>IPA/WallApartment</material>
  434 + </gazebo>
  435 +
  436 + <joint name="joint_wall_ext" type="fixed">
  437 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-2.3} ${-0.68-dist_axis_y} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall}" />
  438 + <parent link="dummy_link" />
  439 + <child link="wall_ext" />
  440 + </joint>
  441 +
  442 +
  443 + <!-- wall ext -->
  444 + <link name="wall_ext2">
  445 + <inertial>
  446 + <origin xyz="0 0 0" />
  447 + <mass value="5.0" />
  448 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  449 + </inertial>
  450 + <visual>
  451 + <origin xyz="0 0 0" />
  452 + <geometry>
  453 + <box size="4.6 0.04 ${size_z_wall1}" />
  454 + </geometry>
  455 + </visual>
  456 + <collision>
  457 + <origin xyz="0 0 0" />
  458 + <geometry>
  459 + <box size="4.6 0.04 ${size_z_wall1}" />
  460 + </geometry>
  461 + </collision>
  462 + </link>
  463 +
  464 + <gazebo reference="wall_ext2">
  465 + <material>IPA/WallApartment</material>
  466 + </gazebo>
  467 +
  468 + <joint name="joint_wall_ext2" type="fixed">
  469 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-2.3} ${-0.68-dist_axis_y+1.6} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall}" />
  470 + <parent link="dummy_link" />
  471 + <child link="wall_ext2" />
  472 + </joint>
  473 +
  474 + <!-- wall ext3 -->
  475 + <link name="wall_ext3">
  476 + <inertial>
  477 + <origin xyz="0 0 0" />
  478 + <mass value="5.0" />
  479 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  480 + </inertial>
  481 + <visual>
  482 + <origin xyz="0 0 0" />
  483 + <geometry>
  484 + <box size="0.04 1.9 ${size_z_wall1}" />
  485 + </geometry>
  486 + </visual>
  487 + <collision>
  488 + <origin xyz="0 0 0" />
  489 + <geometry>
  490 + <box size="0.04 1.9 ${size_z_wall1}" />
  491 + </geometry>
  492 + </collision>
  493 + </link>
  494 +
  495 + <gazebo reference="wall_ext3">
  496 + <material>IPA/WallApartment</material>
  497 + </gazebo>
  498 +
  499 + <joint name="joint_wall_ext3" type="fixed">
  500 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-4.6-0.68} ${-0.68-dist_axis_y-0.65} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  501 + <parent link="dummy_link" />
  502 + <child link="wall_ext3" />
  503 + </joint>
  504 +
  505 + <!-- wall ext4 -->
  506 + <link name="wall_ext4">
  507 + <inertial>
  508 + <origin xyz="0 0 0" />
  509 + <mass value="5.0" />
  510 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  511 + </inertial>
  512 + <visual>
  513 + <origin xyz="0 0 0" />
  514 + <geometry>
  515 + <box size="0.04 0.72 ${size_z_wall1}" />
  516 + </geometry>
  517 + </visual>
  518 + <collision>
  519 + <origin xyz="0 0 0" />
  520 + <geometry>
  521 + <box size="0.04 0.72 ${size_z_wall1}" />
  522 + </geometry>
  523 + </collision>
  524 + </link>
  525 +
  526 + <gazebo reference="wall_ext4">
  527 + <material>IPA/WallApartment</material>
  528 + </gazebo>
  529 +
  530 + <joint name="joint_wall_ext4" type="fixed">
  531 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-4.6-0.68-1.54} ${-0.68-dist_axis_y-0.65-1.54} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  532 + <parent link="dummy_link" />
  533 + <child link="wall_ext4" />
  534 + </joint>
  535 +
  536 +
  537 +
  538 + <!--elevator buttons-->
  539 +
  540 + <link name="elevator_button1">
  541 + <inertial>
  542 + <origin xyz="0 0 0" />
  543 + <mass value="1.0" />
  544 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  545 + </inertial>
  546 + <visual>
  547 + <origin xyz="0 0 0" />
  548 + <geometry>
  549 + <box size="0.01 0.05 0.05" />
  550 + </geometry>
  551 + </visual>
  552 + <collision>
  553 + <origin xyz="0 0 0" />
  554 + <geometry>
  555 + <box size="0.01 0.05 0.05" />
  556 + </geometry>
  557 + </collision>
  558 + </link>
  559 +
  560 +
  561 + <joint name="joint_elevator_button1" type="prismatic">
  562 + <origin xyz="${-0.025} ${0.025} ${-size_z_wall1/2+1.035}" rpy="0 0 0" />
  563 + <parent link="wall_ext4" />
  564 + <child link="elevator_button1" />
  565 +
  566 + <calibration rising="0.0"/>
  567 + <dynamics damping="0.0" friction="0.0"/>
  568 + <limit effort="100" velocity="1.0" lower="0" upper="0" />
  569 + <safety_controller k_velocity="10"/>
  570 +
  571 + </joint>
  572 +
  573 + <gazebo reference="elevator_button1">
  574 + <selfCollide>true</selfCollide>
  575 + <sensor:contact name="elevator_button1_contact_sensor">
  576 + <geom>elevator_button1_geom</geom>
  577 + <updateRate>10</updateRate>
  578 + <controller:gazebo_ros_bumper name="elevator_button1_gazebo_ros_bumper_controller" plugin="libgazebo_ros_bumper.so">
  579 + <alwaysOn>true</alwaysOn>
  580 + <updateRate>10</updateRate>
  581 + <frameName>elevator_button1</frameName>
  582 + <bumperTopicName>elevator_button1_bumper</bumperTopicName>
  583 + <interface:bumper name="elevator_button1_bumper_iface" />
  584 + </controller:gazebo_ros_bumper>
  585 + </sensor:contact>
  586 + <material>Gazebo/Red</material>
  587 + <!--turnGravityOff>false</turnGravityOff-->
  588 + </gazebo>
  589 +
  590 +
  591 + <link name="elevator_button2">
  592 + <inertial>
  593 + <origin xyz="0 0 0" />
  594 + <mass value="1.0" />
  595 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  596 + </inertial>
  597 + <visual>
  598 + <origin xyz="0 0 0" />
  599 + <geometry>
  600 + <box size="0.01 0.05 0.05" />
  601 + </geometry>
  602 + </visual>
  603 + <collision>
  604 + <origin xyz="0 0 0" />
  605 + <geometry>
  606 + <box size="0.01 0.05 0.05" />
  607 + </geometry>
  608 + </collision>
  609 + </link>
  610 +
  611 +
  612 + <joint name="joint_elevator_button2" type="prismatic">
  613 + <origin xyz="${-0.025} ${0.025} ${-size_z_wall1/2+1.095}" rpy="0 0 0" />
  614 + <parent link="wall_ext4" />
  615 + <child link="elevator_button2" />
  616 +
  617 + <calibration rising="0.0"/>
  618 + <dynamics damping="0.0" friction="0.0"/>
  619 + <limit effort="100" velocity="1.0" lower="0" upper="0" />
  620 + <safety_controller k_velocity="10"/>
  621 + </joint>
  622 +
  623 +
  624 +
  625 + <gazebo reference="elevator_button2">
  626 + <selfCollide>true</selfCollide>
  627 + <sensor:contact name="elevator_button2_contact_sensor">
  628 + <geom>elevator_button2_geom</geom>
  629 + <updateRate>10</updateRate>
  630 + <controller:gazebo_ros_bumper name="elevator_button2_gazebo_ros_bumper_controller" plugin="libgazebo_ros_bumper.so">
  631 + <alwaysOn>true</alwaysOn>
  632 + <updateRate>10</updateRate>
  633 + <frameName>elevator_button2</frameName>
  634 + <bumperTopicName>elevator_button2_bumper</bumperTopicName>
  635 + <interface:bumper name="elevator_button2_bumper_iface" />
  636 + </controller:gazebo_ros_bumper>
  637 + </sensor:contact>
  638 + <material>Gazebo/Red</material>
  639 + <turnGravityOff>false</turnGravityOff>
  640 + </gazebo>
  641 +
  642 +
  643 + <!-- elevator 1 -->
  644 + <link name="elevator_left">
  645 + <inertial>
  646 + <origin xyz="0 0 0" />
  647 + <mass value="5.0" />
  648 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  649 + </inertial>
  650 + <visual>
  651 + <origin xyz="0 0 0" />
  652 + <geometry>
  653 + <box size="0.04 0.87 ${size_z_wall1}" />
  654 + </geometry>
  655 + </visual>
  656 + <collision>
  657 + <origin xyz="0 0 0" />
  658 + <geometry>
  659 + <box size="0.04 0.87 ${size_z_wall1}" />
  660 + </geometry>
  661 + </collision>
  662 + </link>
  663 +
  664 + <gazebo reference="elevator_left">
  665 + <material>IPA/Wall2</material>
  666 + </gazebo>
  667 +
  668 + <joint name="joint_elevator_left" type="prismatic">
  669 + <axis xyz = "0 1 0"/>
  670 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-4.6-1.6} ${-0.68-dist_axis_y-1.68} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  671 + <parent link="dummy_link" />
  672 + <child link="elevator_left" />
  673 +
  674 +
  675 + <calibration rising="0.0"/>
  676 + <dynamics damping="0.0" friction="0.0"/>
  677 + <limit effort="100" velocity="1.0" lower="0" upper="0.87" />
  678 + <safety_controller k_velocity="10"/>
  679 + </joint>
  680 +
  681 + <transmission name="elevator_left_trans" type="pr2_mechanism_model/SimpleTransmission">
  682 + <actuator name="elevator_left_motor"/>
  683 + <joint name="elevator_left_joint"/>
  684 + <mechanicalReduction>1</mechanicalReduction>
  685 + </transmission>
  686 +
  687 +
  688 + <!-- wall ext5 -->
  689 + <link name="wall_ext5">
  690 + <inertial>
  691 + <origin xyz="0 0 0" />
  692 + <mass value="5.0" />
  693 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  694 + </inertial>
  695 + <visual>
  696 + <origin xyz="0 0 0" />
  697 + <geometry>
  698 + <box size="2.4 0.04 ${size_z_wall1}" />
  699 + </geometry>
  700 + </visual>
  701 + <collision>
  702 + <origin xyz="0 0 0" />
  703 + <geometry>
  704 + <box size="2.4 0.04 ${size_z_wall1}" />
  705 + </geometry>
  706 + </collision>
  707 + </link>
  708 +
  709 + <gazebo reference="wall_ext5">
  710 + <material>IPA/WallApartment</material>
  711 + </gazebo>
  712 +
  713 + <joint name="joint_wall_ext5" type="fixed">
  714 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-5.1} ${-0.68-dist_axis_y-0.65-1.5} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  715 + <parent link="dummy_link" />
  716 + <child link="wall_ext5" />
  717 + </joint>
  718 +
  719 + <!-- wall ext6 -->
  720 + <link name="wall_ext6">
  721 + <inertial>
  722 + <origin xyz="0 0 0" />
  723 + <mass value="5.0" />
  724 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  725 + </inertial>
  726 + <visual>
  727 + <origin xyz="0 0 0" />
  728 + <geometry>
  729 + <box size="2.4 0.04 ${size_z_wall1}" />
  730 + </geometry>
  731 + </visual>
  732 + <collision>
  733 + <origin xyz="0 0 0" />
  734 + <geometry>
  735 + <box size="2.4 0.04 ${size_z_wall1}" />
  736 + </geometry>
  737 + </collision>
  738 + </link>
  739 +
  740 + <gazebo reference="wall_ext6">
  741 + <material>IPA/WallApartment</material>
  742 + </gazebo>
  743 +
  744 + <joint name="joint_wall_ext6" type="fixed">
  745 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-5.1-0.615} ${-0.68-dist_axis_y-0.65-1.5-0.615} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  746 + <parent link="dummy_link" />
  747 + <child link="wall_ext6" />
  748 + </joint>
  749 +
  750 + <!-- elevator_left2 -->
  751 + <link name="elevator_left2">
  752 + <inertial>
  753 + <origin xyz="0 0 0" />
  754 + <mass value="5.0" />
  755 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  756 + </inertial>
  757 + <visual>
  758 + <origin xyz="0 0 0" />
  759 + <geometry>
  760 + <box size="0.04 0.87 ${size_z_wall1}" />
  761 + </geometry>
  762 + </visual>
  763 + <collision>
  764 + <origin xyz="0 0 0" />
  765 + <geometry>
  766 + <box size="0.04 0.87 ${size_z_wall1}" />
  767 + </geometry>
  768 + </collision>
  769 + </link>
  770 +
  771 + <gazebo reference="elevator_left2">
  772 + <material>IPA/WallApartment</material>
  773 + </gazebo>
  774 +
  775 + <joint name="joint_elevator_left2" type="fixed">
  776 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-1.6-3} ${-0.68-dist_axis_y-1.68-1.6} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  777 + <parent link="dummy_link" />
  778 + <child link="elevator_left2" />
  779 + </joint>
  780 +
  781 + <!-- elevator 2 -->
  782 + <link name="elevator_right">
  783 + <inertial>
  784 + <origin xyz="0 0 0" />
  785 + <mass value="5.0" />
  786 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  787 + </inertial>
  788 + <visual>
  789 + <origin xyz="0 0 0" />
  790 + <geometry>
  791 + <box size="0.04 0.87 ${size_z_wall1}" />
  792 + </geometry>
  793 + </visual>
  794 + <collision>
  795 + <origin xyz="0 0 0" />
  796 + <geometry>
  797 + <box size="0.04 0.87 ${size_z_wall1}" />
  798 + </geometry>
  799 + </collision>
  800 + </link>
  801 +
  802 + <gazebo reference="elevator_right">
  803 + <material>IPA/Wall2</material>
  804 + </gazebo>
  805 +
  806 + <joint name="joint_elevator_right" type="prismatic">
  807 + <axis xyz = "0 -1 0"/>
  808 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-4.6-1.6-1.15} ${-0.68-dist_axis_y-1.68-1.15} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  809 + <parent link="dummy_link" />
  810 + <child link="elevator_right" />
  811 +
  812 + <calibration rising="0.0"/>
  813 + <dynamics damping="0.0" friction="0.0"/>
  814 + <limit effort="100" velocity="1.0" lower="0" upper="0.87" />
  815 + <safety_controller k_velocity="10"/>
  816 + </joint>
  817 +
  818 + <transmission name="elevator_right_trans" type="pr2_mechanism_model/SimpleTransmission">
  819 + <actuator name="elevator_right_motor"/>
  820 + <joint name="elevator_right_joint"/>
  821 + <mechanicalReduction>1</mechanicalReduction>
  822 + </transmission>
  823 +
  824 + <!-- wall ext7 -->
  825 + <link name="wall_ext7">
  826 + <inertial>
  827 + <origin xyz="0 0 0" />
  828 + <mass value="5.0" />
  829 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  830 + </inertial>
  831 + <visual>
  832 + <origin xyz="0 0 0" />
  833 + <geometry>
  834 + <box size="2.4 0.04 ${size_z_wall1}" />
  835 + </geometry>
  836 + </visual>
  837 + <collision>
  838 + <origin xyz="0 0 0" />
  839 + <geometry>
  840 + <box size="2.4 0.04 ${size_z_wall1}" />
  841 + </geometry>
  842 + </collision>
  843 + </link>
  844 +
  845 + <gazebo reference="wall_ext7">
  846 + <material>IPA/WallApartment</material>
  847 + </gazebo>
  848 +
  849 + <joint name="joint_wall_ext7" type="fixed">
  850 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-5.1-1.15} ${-0.68-dist_axis_y-0.65-1.5-1.15} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  851 + <parent link="dummy_link" />
  852 + <child link="wall_ext7" />
  853 + </joint>
  854 +
  855 + <!-- wall ext8 -->
  856 + <link name="wall_ext8">
  857 + <inertial>
  858 + <origin xyz="0 0 0" />
  859 + <mass value="5.0" />
  860 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  861 + </inertial>
  862 + <visual>
  863 + <origin xyz="0 0 0" />
  864 + <geometry>
  865 + <box size="2.4 0.04 ${size_z_wall1}" />
  866 + </geometry>
  867 + </visual>
  868 + <collision>
  869 + <origin xyz="0 0 0" />
  870 + <geometry>
  871 + <box size="2.4 0.04 ${size_z_wall1}" />
  872 + </geometry>
  873 + </collision>
  874 + </link>
  875 +
  876 + <gazebo reference="wall_ext8">
  877 + <material>IPA/WallApartment</material>
  878 + </gazebo>
  879 +
  880 + <joint name="joint_wall_ext8" type="fixed">
  881 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-5.1-1.78} ${-0.68-dist_axis_y-0.65-1.5-1.78} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  882 + <parent link="dummy_link" />
  883 + <child link="wall_ext8" />
  884 + </joint>
  885 +
  886 + <!-- elevator 22 -->
  887 + <link name="elevator_right2">
  888 + <inertial>
  889 + <origin xyz="0 0 0" />
  890 + <mass value="5.0" />
  891 + <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0" />
  892 + </inertial>
  893 + <visual>
  894 + <origin xyz="0 0 0" />
  895 + <geometry>
  896 + <box size="0.04 0.87 ${size_z_wall1}" />
  897 + </geometry>
  898 + </visual>
  899 + <collision>
  900 + <origin xyz="0 0 0" />
  901 + <geometry>
  902 + <box size="0.04 0.87 ${size_z_wall1}" />
  903 + </geometry>
  904 + </collision>
  905 + </link>
  906 +
  907 + <gazebo reference="elevator_right2">
  908 + <material>IPA/WallApartment</material>
  909 + </gazebo>
  910 +
  911 + <joint name="joint_elevator_right2" type="fixed">
  912 + <origin xyz="${-size_total_x/2+dist_axis_x-wall_depth-1.6-1.15-3} ${-0.68-dist_axis_y-1.68-1.15-1.6} ${size_z_wall1/2}" rpy="0 0 ${-dist_axis_yall-0.7853}" />
  913 + <parent link="dummy_link" />
  914 + <child link="elevator_right2" />
  915 + </joint>
411 916 <!-- cabinet1 -->
412 917 <link name="cabinet1">
413 918 <inertial>
1  cob_gazebo_worlds/ros/launch/ipa-apartment.launch
@@ -4,5 +4,6 @@
4 4 <!-- start gazebo world from .urdf file -->
5 5 <include file="$(find cob_gazebo_worlds)/ros/launch/world_urdf.launch" />
6 6
  7 + <node name="elevator" pkg="cob_gazebo_worlds" type="elevator.py" respawn="false" output="screen" />
7 8
8 9 </launch>
70 cob_gazebo_worlds/ros/src/elevator.py
... ... @@ -0,0 +1,70 @@
  1 +#!/usr/bin/python
  2 +
  3 +import time
  4 +import sys
  5 +import roslib
  6 +roslib.load_manifest('cob_gazebo_worlds')
  7 +import rospy
  8 +import random
  9 +from math import *
  10 +
  11 +from gazebo.srv import *
  12 +from gazebo_msgs.srv import *
  13 +from gazebo_msgs.msg import *
  14 +
  15 +
  16 +apply_effort_service = rospy.ServiceProxy('/gazebo/apply_joint_effort', ApplyJointEffort)
  17 +door_closed = True
  18 +
  19 +
  20 +
  21 +def callback(ContactsState):
  22 +
  23 + if door_closed:
  24 + if (ContactsState.states != []):
  25 + rospy.loginfo("button pressed")
  26 + rand = (random.randint(0,1))
  27 + if rand == 0:
  28 + move_door("left")
  29 + else:
  30 + move_door("right")
  31 + else:
  32 + rospy.logdebug("button not pressed")
  33 + else:
  34 + rospy.loginfo("Door Opened")
  35 +
  36 +
  37 +
  38 +def listener():
  39 +
  40 + rospy.init_node('listener', anonymous=True)
  41 + rospy.Subscriber("/elevator_button1_bumper/state", ContactsState, callback, queue_size=1)
  42 + rospy.spin()
  43 +
  44 +def move_door(side):
  45 +
  46 + door_closed = False
  47 + req = ApplyJointEffortRequest()
  48 + req.joint_name = 'joint_elevator_'+side
  49 + req.start_time.secs = 0
  50 + req.duration.secs = -10
  51 + req.effort = 500
  52 + rospy.loginfo("door is opening")
  53 + res = apply_effort_service(req)
  54 +
  55 + rospy.sleep(10)
  56 + req.effort = -1000
  57 + rospy.loginfo("door is closing")
  58 + res = apply_effort_service(req)
  59 +
  60 + rospy.sleep(10)
  61 + req.effort = 500
  62 + res = apply_effort_service(req)
  63 + door_closed = True
  64 +
  65 +
  66 +if __name__ == '__main__':
  67 + listener()
  68 +
  69 +
  70 +

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.