{"id":19855201,"url":"https://github.com/leggedrobotics/perceptive_mpc","last_synced_at":"2025-06-20T10:07:12.678Z","repository":{"id":83356464,"uuid":"242604483","full_name":"leggedrobotics/perceptive_mpc","owner":"leggedrobotics","description":"Code for \"Perceptive Model Predictive Control for Continuous Mobile Manipulation\"","archived":false,"fork":false,"pushed_at":"2021-12-30T17:11:32.000Z","size":8544,"stargazers_count":175,"open_issues_count":3,"forks_count":31,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T20:46:33.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leggedrobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-02-23T22:55:59.000Z","updated_at":"2025-04-05T08:22:11.000Z","dependencies_parsed_at":"2023-03-12T18:07:40.842Z","dependency_job_id":null,"html_url":"https://github.com/leggedrobotics/perceptive_mpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fperceptive_mpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fperceptive_mpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fperceptive_mpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fperceptive_mpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leggedrobotics","download_url":"https://codeload.github.com/leggedrobotics/perceptive_mpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251969276,"owners_count":21673184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T14:12:00.552Z","updated_at":"2025-05-02T01:30:42.421Z","avatar_url":"https://github.com/leggedrobotics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Perceptive Model Predictive Control for Continuous Mobile Manipulation\n\nThis repository contains the source code for our work on perceptive model predictive control.\nPlease find the full text of the paper [here](https://www.research-collection.ethz.ch/handle/20.500.11850/426821).\n\nJ. Pankert and M. Hutter, “Perceptive Model Predictive Control for Continuous Mobile Manipulation,” *IEEE Robotics and Automation Letters*, vol. 5, no. 4, pp. 6177–6184, Oct. 2020.\n\n```\n@article{pankertPerceptiveModelPredictive2020a,\n  title = {Perceptive {{Model Predictive Control}} for {{Continuous Mobile Manipulation}}},\n  author = {Pankert, Johannes and Hutter, Marco},\n  year = {2020},\n  month = oct,\n  volume = {5},\n  pages = {6177--6184},\n  issn = {2377-3766},\n  doi = {10.1109/LRA.2020.3010721},\n  journal = {IEEE Robotics and Automation Letters},\n  number = {4}\n}\n```\n\nVideos of our hardware experiments can be seen [here](https://youtu.be/cTXytsWyFxE).\n\n## Installation\n\nThe software has been tested with Ros Melodic under Ubuntu 18.04.\n\nCreate a new catkin workspace, configure it to build in release, download all dependencies with wstool and build ``perceptive_mpc``.\n```\nsudo apt install python-catkin-tools libglpk-dev python-wstool -y\nsource /opt/ros/melodic/setup.bash\nmkdir perceptive_mpc_ws\ncd perceptive_mpc_ws\nmkdir src\ncatkin init\ncatkin config --extend /opt/ros/melodic --cmake-args -DCMAKE_BUILD_TYPE=Release\ncd src\ngit clone https://github.com/leggedrobotics/perceptive_mpc.git\nwstool init . ./perceptive_mpc/perceptive_mpc_https.rosinstall\ncatkin build perceptive_mpc\n```\n\nAlternatively, you can also create a docker image by running:\n```\ndocker image build -t perceptive_mpc:v0.3 .\n```\nor pull the image from dockerhub:\n```\ndocker pull rslethz/perceptive_mpc\n```\n\n## Demos\n\n### Motion Planning\nThe easiest way to test the software is to use the provided launchfiles in the ```perceptive_mpc``` package.\n\n\n```roslaunch perceptive_mpc demo.launch```:\n\nThis will launch a kinematic simulation of the motion planner. The computed optimal state is set as the observation of the MPC. An end-effector target can be set with an interactive marker in RVIZ.\n\nIf you use the docker image, run the following commands instead:\n```\nxhost local:root\ndocker container run -it --rm --name mpc_demo \\\n -e DISPLAY=$DISPLAY \\\n -v /tmp/.X11-unix:/tmp/.X11-unix \\\n --device /dev/dri \\\n perceptive_mpc:v0.3 ./src/perceptive_mpc/scripts/run_demo.sh\n```\n\n### Collision Avoidance\n\n```roslaunch perceptive_mpc collision_avoidance_demo.launch```:\n\nLaunches the MPC controller with collision avoidance. Call the following service to load a Euclidian Signed Distance Field (ESDF) map:\n\n```rosservice call /voxblox_node/load_map \"file_path: '/path/to/esdf/map.esdf'\"```\n\nAn demo map ```example_map.esdf``` is contained in the example directory.\n\nIf you use the docker image, run the following commands instead:\n```\nxhost local:root\ndocker container run -it --rm --name collision_avoidance_demo \\\n -e DISPLAY=$DISPLAY \\\n -v /tmp/.X11-unix:/tmp/.X11-unix \\\n --device /dev/dri \\\n perceptive_mpc:v0.3 ./src/perceptive_mpc/scripts/run_demo_collision_avoidance.sh\n```\nAfter everything started, load a map by running:\n```\ndocker exec collision_avoidance_demo ./src/perceptive_mpc/scripts/load_map.sh\n```\n## Mechanical Stability\nThe ZMP mechanical stability constraint is active by default.\nThe radius of the support circle (circle inscribing the support polygon) can be set in the task.info configuration file.\nIn the kinematic simulation, the external wrench is set to a default value specified in the `kinematic_simulation_parameters.yaml` file. The wrench is specified in end-effector reference frame.\nBy sending a `WrenchPoseTrajectory` message, a time varying wrench can be specified. The wrenches in this message are again specified in the desired end-effector reference frame. The end-effector references themselves need to be specified in world frame.\n## Robot integration\nThe software can easily be integrated with a mobile manipulator platform. The configuration can be copied from ```perceptive_mpc/example/KinematicSimulation.cpp```. The tracker thread is the main control loop. The current state estimate has to be set as the system observation. The optimal control inputs can be forwarded to the motor controllers.\n\nThe admittance control module can only be tested on hardware or in a physics based simulation. The source code of ```KinematicSimulation.[h|cpp]``` contains hints on how to interface with the module.\n\nIn order to use your custom manipulator, derive from the ```KinematicsInterface``` class and override the purely virtual methods for forward kinematics computation. We provide kinematic implementations for some popular robots:\n* Mabi Speedy 12\n* UR10\n* UR5\n* UR3\n\nThe kinematics code was generated with [RobCoGen v0.4ad.0](https://robcogenteam.bitbucket.io/index.html).\nRobcogen requires robot descriptions in the .kindsl/.dtdsl format. The [urdf2robcogen](https://github.com/leggedrobotics/urdf2robcogen/tree/v1.0) tool converts to this format from .urdf files.\n\n## License\nBSD-3-Clause\nCopyright (c) 2020 Johannes Pankert \u003cpankertj@ethz.ch\u003e\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n3. Neither the name of this work nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleggedrobotics%2Fperceptive_mpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleggedrobotics%2Fperceptive_mpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleggedrobotics%2Fperceptive_mpc/lists"}