Skip to content

developer notes

Vanessa Hassouna edited this page Aug 8, 2023 · 4 revisions

Manipulation-interface

all defgeneric functions

  • get-action-gripping-effort(object-type)
    • returns effort in Nm e.g. 50
  • get-action-gripping-opening(object-type)
    • how wide to open the gripper before grasping, in m or radiants
  • get-action-grasp(object-type arm object-transform-in-base)
    • returns a lazy list of keywords that repreent the possible grasp orientations
  • get-object-type-carry-config (object-type grasp)
    • When carrying an object, which arm configuration to use. The return value is a symbol (keyword), which associates with a robot-specific joint state, specified in the robot description.
  • get-action-trajectory (action-type arm grasp location objects-acted-on)
    • Returns a list of TRAJ-SEGMENTs. engine is the keyword describing the reasoning engine that calculates trajectories, action-type describes for which type of action the trajectory will be, arm a single keyword eg. :left, grasp describes grasp orientation to use, e.g., :top, :left-side, location is the location type of the action, e.g., counter-top or shelf objects-acted-on are designators describing the objects used by the action.
  • get-location-poses (location-designator)
    • Returns a (lazy) list of cl-transforms-pose-stamped that, according to the reasoning engine, correspond to the given location-designator.
  • get-object-likely-location (object-type environment-name human-name context)
    • Returns a location designator representing the location, where an object with given type object-type can typically be found at. The likely location can depend on the environment-name, the human preferences represented as human-name and context representing the name of the action context, e.g. :table-setting.
  • get-object-destination (object-type environment-name human-name context)
    • Returns a location designator representing the location, where an object with given type object-type usually should be brought to in the given action context context, e.g., :table-setting.. The likely destination can additionally depend on the environment-name and the human preferences represented as human-name.
  • get-container-opening-distance (container-name)
    • Returns a value describing the distance a container can be openend. container-designator is a designator describing the container.
  • get-container-closing-distance (container-name)
    • Returns a value describing the distance for which a container is considered closed.
  • get-arms-for-object-type (object-type)
    • Returns the arm to use for grasping the object of given object-type. If nil is returned, it does not matter, which arm is used.

Popcorn-demo-Knowrob

Bugs

  • On (ccl:start-episode) the Knowrob/Rosprolog node gets stuck and the last Warning it shows is:
    Warning:    Singleton variables: [Event]
    Warning: /home/alina/ros_ws/k4r/cram_ws/src/cram/cram_knowrob/cram_cloud_logger/src/neem-interface.pl:36:
    Warning:    Singleton variables: [Start]
    Warning: /home/alina/ros_ws/k4r/cram_ws/src/cram/cram_knowrob/cram_cloud_logger/src/neem-interface.pl:47:
    Warning:    Singleton variables: [Event,Start,End]
    Warning: /home/alina/ros_ws/k4r/cram_ws/src/cram/cram_knowrob/cram_cloud_logger/src/neem-interface.pl:71:
    Warning:    Singleton variables: [Position,Orientation]```
    

:::info Fixed by updating the environment-urdf to e.g: (defparameter environment-urdf "'package://iai_kitchen/urdf_obj/iai_kitchen_popcorn_python.urdf'") Ideally, this should be read from the parameter server so that one wouldn't need to update this manually, since it will change for every scenario... Also make sure the urdf is correctly build and uploaded. If you build it with: rosrun xacro xacro my-urdf.urdf.xacro > my-urdf.urdf and it looks to small, something might be wrong with the macros pr a xacro prefix is missing somewhere. ::: :::success the getting stuck of the prolog node can be prevented by commenting out the last query in the neem-interface.pl. aka: %test__query :- ask([triple('http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#Action_DCJBWPIE',dul:'hasTimeInterval',_O), triple(_O, soma:'hasIntervalBegin', _T2)]),time_scope(=<(_T2), >=(_T2), QScope),writeln(_T2),tf_get_pose('base_footprint', ['map',Position,Orientation], QScope, _),!.

Why? Who the hell knows... :::

Oven-Area

Getting the bread out of the oven should be easy kinematically, but the tray within the oven is not modeld in the URDF.

:::info I will prolly add a prismatic joint soon, since i want to pull out the tray. I dont think i will model the 3d Part tho. :::

URoboSim installations

sudo apt install ros-noetic-rosbridge-server ros-noetic-robot-state-publisher ros-noetic-joint-state-publisher-gui ros-noetic-tf ros-noetic-tf2 ros-noetic-tf2-ros ros-noetic-pr2-arm-kinematics

mkdir -p ~/unreal_project_ws/src
cd ~/unreal_project_ws/src
wstool init
wstool merge https://raw.githubusercontent.com/urobosim/DemoProject/master/rosinstall/unreal_demo_project.rosinstall
wstool up
rosdep update
rosdep install --from-paths --ignore-src . -r

Common-Errors

==Error: 0== Dont use python3-rosdep2 use python3-rosdep.

==Error: 1== Heap exhausted :::success Fixed by: /opt/ros/noetic/share/roslisp/scripts/make_exe_script change from: "true"; exec /usr/bin/env sbcl --noinform --load $ROSLISP_PATH/scripts/roslisp-sbcl-init --script "$0" "$@" to: "true"; exec /usr/bin/env sbcl --dynamic-space-size 2048 --noinform --load $ROSLISP_PATH/scripts/roslisp-sbcl-init --script "$0" "$@" ::: ==Error: 2== while running melodic demos on noetic: if there seems to be issues with the launch files which load the URDF's, it could be caused by xacro. Change the xacro.py call into xacro. The --inorder prefix is also no longer needed since xacro processes stuff inorder by default now.

==Error: 3== appears when (roslisp-utilities::startup-ros) is called :::danger [(ROSNODE) INFO] 1640713105.398: ROS init #. WARNING: An error occurred while executing the lisp function APPLY': The assertion CRAM-BULLET-REASONING:RIGID-BODIES failed.' ::: OR It freezes entierly. Bullet world might get unresponsive or CRAM get's stuck in the "Init Projection" step. Solution? :::success Make sure your urdf is up to date! Everything needs to be prefixed with the xacro: tag. :::
Otherwise this error happens and if you try to generate one urdf for the environment from all the urdf.xacro files, the file will be small and some imports will be missing. This will also lead to potential KnowRob Errors down the line.

==Error: 4== Catkin_make master knowrob:

  1. No package 'json-glib-1.0' found :::success Had a missing single development package: sudo apt-get install libjson-glib-dev :::
  2. No package 'libmongoc-1.0' found :::success Had a missing single development package: sudo apt install libmongoc-dev :::