Code Monkey home page Code Monkey logo

panther's Introduction

PANTHER: Perception-Aware Trajectory Planner in Dynamic Environments

PANTHER: Perception-Aware Trajectory Planner in Dynamic Environments PANTHER: Perception-Aware Trajectory Planner in Dynamic Environments
PANTHER: Perception-Aware Trajectory Planner in Dynamic Environments PANTHER: Perception-Aware Trajectory Planner in Dynamic Environments

Citation

When using PANTHER, please cite PANTHER: Perception-Aware Trajectory Planner in Dynamic Environments (pdf and video):

@article{tordesillas2021panther,
  title={{PANTHER}: Perception-Aware Trajectory Planner in Dynamic Environments},
  author={Tordesillas, Jesus and How, Jonathan P},
  journal={arXiv preprint arXiv:2103.06372},
  year={2021}
}

If you are looking for a Planner

  • In Multi-Agent and Dynamic Environments, you may be interesed also in MADER (pdf, video):
  • In Static Unknown environments, you may be interesed also in FASTER (pdf, video)

General Setup

PANTHER has been tested with Ubuntu 20.04/ROS Noetic. Other Ubuntu/ROS version may need some minor modifications, feel free to create an issue if you have any problems.

You can use PANTHER with only open-source packages. Matlab is only needed if you want to introduce modifications to the optimization problem.

Dependencies

CGAL

These commands will install CGAL v4.12.4:

sudo apt-get install libgmp3-dev libmpfr-dev -y
mkdir -p ~/installations/cgal && cd ~/installations/cgal
wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.14.2/CGAL-4.14.2.tar.xz
tar -xf CGAL-4.14.2.tar.xz && cd CGAL-4.14.2/ && cmake . -DCMAKE_BUILD_TYPE=Release && sudo make install

CasADi and IPOPT

Install CasADi from source (see this for more details) and the solver IPOPT:

sudo apt-get install gcc g++ gfortran git cmake liblapack-dev pkg-config --install-recommends
sudo apt-get install swig
sudo apt-get install coinor-libipopt-dev
cd ~/installations #Or any other folder of your choice
git clone https://github.com/casadi/casadi.git -b master casadi
cd casadi && mkdir build && cd build
cmake . -DCMAKE_BUILD_TYPE=Release -DWITH_PYTHON=ON -DWITH_IPOPT=ON .. 
sudo make install

Linear Solvers

Go to http://www.hsl.rl.ac.uk/ipopt/, click on Personal Licence, Source to install the solver MA27 (free for everyone), and fill and submit the form. Once you receive the corresponding email, download the compressed file, uncompress it, and place it in the folder ~/installations (for example). Then execute the following commands:

Note: the instructions below follow this closely

cd ~/installations/coinhsl-2015.06.23
wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD/metis-4.0.3.tar.gz #This is the metis version used in the configure file of coinhsl
tar xvzf metis-4.0.3.tar.gz
#sudo make uninstall && sudo make clean #Only needed if you have installed it before
./configure LIBS="-llapack" --with-blas="-L/usr/lib -lblas" CXXFLAGS="-g -O3 -fopenmp" FCFLAGS="-g -O3 -fopenmp" CFLAGS="-g -O3 -fopenmp" #the output should say `checking for metis to compile... yes`
sudo make install #(the files will go to /usr/local/lib)
cd /usr/local/lib
sudo ln -s libcoinhsl.so libhsl.so #(This creates a symbolic link `libhsl.so` pointing to `libcoinhsl.so`). See https://github.com/casadi/casadi/issues/1437
echo "export LD_LIBRARY_PATH='\${LD_LIBRARY_PATH}:/usr/local/lib'" >> ~/.bashrc
Note

We recommend to use MA27. Alternatively, you can install both MA27 and MA57 by clicking on Coin-HSL Full (Stable) Source (free for academia) in http://www.hsl.rl.ac.uk/ipopt/ and then following the instructions above. Other alternative is to use the default mumps solver (no additional installation required), but its much slower than MA27 or MA57.

Other dependencies

sudo apt-get install ros-"${ROS_DISTRO}"-rviz-visual-tools  ros-"${ROS_DISTRO}"-tf2-sensor-msgs
sudo apt-get install git-lfs ccache 

To be able to use catkin build, run:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

And then

  • If you have Ubuntu 18.04, run sudo apt-get install python-catkin-tools -y
  • If you have Ubuntu 20.04 run sudo apt-get install python3-osrf-pycommon python3-catkin-tools -y

Additionally, if you have Ubuntu 20.04, you'll need sudo apt-get install python-is-python3 -y

Optional (only if you want to modify the optimization problem, or use a different solver than MA27. MATLAB needed)

The easiest way to do this is to install casadi from binaries by simply following these commands:

cd ~/installations
mkdir casadi
wget https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-matlabR2014b-v3.5.5.tar.gz
tar xvzf casadi-linux-matlabR2014b-v3.5.5.tar.gz -C ./casadi

Open Matlab, execute the command edit(fullfile(userpath,'startup.m')), and add the line addpath(genpath('/home/YOUR_USERNAME/installations/casadi')) in that file (changing YOUR_USERNAME with your username). This file startup.m is executed every time Matlab starts.

Then you can restart Matlab (or run the file startup.m), and make sure this works:

import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))

Then, to use a specific linear solver, you simply need to change the name of linear_solver_name in the file main.m. You can also introduce more changes in the optimization problem in that file. After these changes, you need to run main.m twice: first with pos_is_fixed=false and then with pos_is_fixed=true. This will generate all the necessary files in the panther/matlab/casadi_generated_files folder. These files will be read by C++.

Note: When using a linear solver different from mumps, you need to start Matlab from the terminal (typing matlab).More info in this issue.

Note: Instead of the binary installation explained in this section, another (but not so straightforward) way would be to use the installation from source done above, but it requires some patches to swig, see this.

Compilation

cd ~/Desktop && mkdir ws && cd ws && mkdir src && cd src
git clone https://github.com/mit-acl/panther.git
cd panther
git lfs install
git submodule init && git submodule update
cd ../../ && catkin build
echo "source ~/Desktop/ws/devel/setup.bash" >> ~/.bashrc 
source ~/.bashrc

Running Simulations

Simply execute

roslaunch panther simulation.launch quad:=SQ01s

Now you can press G (or click the option 2D Nav Goal on the top bar of RVIZ) and click any goal for the drone.

You can also change the following arguments when executing roslaunch

Argument Description
quad Name of the drone
perfect_controller If true, the drone will track perfectly the trajectories, and the controller and physics engine of the drone will not be launched. If false, you will need to clone and compile snap_sim, snap and outer_loop
perfect_prediction If true, the drone will have access to the ground truth of the trajectories of the obstacles. If false, the drone will estimate their trajectories (it needs gazebo:=true in this case).
gui_mission If true, a gui will be launched to start the experiment
rviz If true, Rviz will be launched for visualization
gazebo If true, Gazebo will be launched
gzclient If true, the gui of Gazebo will be launched. If false, (and if gazebo:=true) only gzserver will be launched. Note: right now there is some delay in the visualization of the drone the gui of Gazebo. But this doesn't affect the point clouds generated.

You can see the default values of these arguments in simulation.launch.

NOTE: (TODO) Right now the radius of the drone plotted in Gazebo (which comes from the scale field of quadrotor_base_urdf.xacro) does not correspond with the radius specified in panther.yaml.

Credits:

This package uses some the hungarian-algorithm-cpp and some C++ classes from the DecompROS and repos (both included in the thirdparty folder), so credit to them as well.


Approval for release: This code was approved for release by The Boeing Company in March 2021.

panther's People

Contributors

jtorde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

panther's Issues

terminate called after throwing an instance of 'std::invalid_argument'

I am trying panther on Ubuntu 18.04 and ros-melodic
I've completed procedure to build and install panther and it's dependencies.
I proceeds to run: roslaunch panther simulation.launch quad:=SQ01s
And panther-node died immediately as following image:
image
After that, I run panther-node in separated terminal: rosrun panther panther_node ~state:=state ~who_plans:=who_plans term_goal:=term_goal ~trajs_predicted:=tracker_predictor_node/trajs_predicted ~traj:=traj ~trajs_zhejiang:=trajs_zhejiang ~goal:=goal ~setpoint:=setpoint __name:=panther
I thrown this error:
"terminate called after throwing an instance of 'std::invalid_argument'
what(): stoi
Aborted (core dumped)"

Error rqt_gui application

Hello everyone,

I've been following the tutorial in the Readme.md. However, as con you can see in the attached image, I have some problems with the rqt_gui.

I'm using ROS Noetic on Ubuntu 20.04. However the rqt_gui crashes. The error says:

TypeError: arguments did not match any overloaded call:
QByteArray(): too many arguments
QByteArray(int, str): argument 1 has unexpected type 'str'
QByteArray(Union[QByteArray, bytes, bytearray]): argument 1 has unexpected type 'str'

I've tried to fix it by following the answer found in this link: https://answers.ros.org/question/365220/rqt_gui-error-in-perspective-manager-in-ros-noetic/ . Basically I have changed "QtCore.QByteArray('000000ff00000000fd00000001...00')" on the line number 436 by "b'000000ff00000000fd00000001...00'" on the demo_interface.perspective document (https://github.com/mit-acl/panther/blob/master/panther/rqt_cfgs/demo_interface.perspective). However it does not solve the problem.

Any idea?

Thanks

Panther_ERROR

/usr/local/lib/libhsl.so: undefined symbol: isamax_

I follow the instruction and finish the complie. After I click a goal for the drone,I get the error:

IN REPLAN CB
trajs_.size()= 1
[Selection] Probs of coll --> 0e-15,
[Selection] Chosen Trajectory 0, P(collision)= 0e-5
[Selection] Focusing on obstacle, angle=24.4 deg
initial_state=
Pos, Vel, Accel, Jerk, Yaw, DYaw= 0 0 0 0 0 0 0 0 0 0 0 0 -0.32 0
final_state=
Pos, Vel, Accel, Jerk, Yaw, DYaw= 4.23 -1.48 0.375 0 0 0 0 0 0 0 0 0 0 0
Solved so far0/1
in SolverIpopt::optimize
[NL] Running A
from0 0 0 to 4.23 -1.48 0.375, allowing time = 350 ms
[A
] Running...
[A
] openList_ is empty
[A*] choosing closest complete path as solution
complete_closest_dist_so_far_= 1.61
[ INFO] [1645000821.975377700, 5.100000000]: [NL] A* found a feasible solution!
Shortest path: -0.32 --> 0 --> 0.15708 --> 0.314159 --> 0.314159 --> 0.314159 --> 0.314159 --> 0.314159 --> 0.471239 --> 0.471239 --> 0.628319 --> 0.785398 --> 0.942478 --> 0.942478
Optimizing for YAW and POSITION!
Exception of type: OPTION_INVALID in file "IpAlgBuilder.cpp" at line 321:
Exception message: Selected linear solver MA27 not available.
Tried to obtain MA27 from shared library "libhsl.so", but the following error occured:
/usr/local/lib/libhsl.so: undefined symbol: isamax_

EXIT: Invalid option encountered.
solver : t_proc (avg) t_wall (avg) n_eval
nlp_grad | 504.00us (504.00us) 362.12us (362.12us) 1
total | 1.81ms ( 1.81ms) 668.36us (668.36us) 1
optimstatus= Invalid_Option
IPOPT failed to find a solution
Solver failed

The reason for this seems to be: /usr/local/lib/libhsl.so: undefined symbol: isamax_, how should I do to solve this?
2022-02-16 16-47-53 的屏幕截图

README link to paper missing!

Very minor issue of course -- I was able to find the paper on Arxiv anyway, but I thought you might want to know that the link in the README just links to the Arxiv homepage :)

DeserializingStream sanity check failed

While running roslaunch panther simulation.launch quad:=SQ01s, I am getting the following error and then the process dies (Trying to specify the goal position using G or 2D Nav Goal doesn't work as well) :

[INFO] [1640295936.156948, 0.000000]: Loading model XML from ros parameter robot_description
Starting perfect tracker node for: /SQ01s/
[INFO] [1640295936.208657, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[INFO] [1640295938.287394, 0.000000]: Loading model XML from file 
/home/piyush/panther_ws/src/panther/panther/meshes/tmp_0.urdf
[INFO] [1640295938.290552, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1640295953.298561116]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1640295953.302099473]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, 
waiting...
[ INFO] [1640295955.478527787]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[INFO] [1640295955.502009, 0.000000]: Calling service /gazebo/spawn_urdf_model
[INFO] [1640295955.524182, 0.000000]: Calling service /gazebo/spawn_urdf_model
**DISABLING PHYSICS**
[INFO] [1640295955.601097, 0.001000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1640295955.607068139, 0.001000000]: Physics dynamic reconfigure ready.
[INFO] [1640295957.281193, 0.197000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1640295957.297051071, 0.213000000]: Found transform SQ01s --> SQ01s/camera_depth_optical_frame
Basis chosen: MINVO
Parameters obtained, checking them...
par_.fov_depth= 5
par_.Ra= 4.5
par_.drone_radius= 0.2
Parameters checked
Changing DroneStatus from TRAVELING to GOAL_REACHED
[SQ01s/spawn_robot-3] process has finished cleanly
log file: /home/piyush/.ros/log/9f674d0c-6439-11ec-9abd-d0abd521f44e/SQ01s-spawn_robot-3*.log
terminate called after throwing an instance of 'casadi::CasadiException'
  what():  .../casadi/core/serializing_stream.cpp:55: Assertion "check==serialization_check" failed:
DeserializingStream sanity check failed. Expected 123456789012345, but got -5863120225865027243.
[ INFO] [1640295958.262307913, 1.174000000]: Camera Plugin: Using the 'robotNamespace' param: '/SQ01s/'
[ INFO] [1640295958.267886238, 1.180000000]: Camera Plugin (ns = /SQ01s/)  <tf_prefix_>, set to "/SQ01s"
[ WARN] [1640295958.268088816, 1.180000000]: dynamic reconfigure is not enabled for this image topic 
[camera/rgb/image_raw] becuase <cameraName> is not specified
[SQ01s/panther-13] process has died [pid 3137, exit code -6, 
cmd /home/piyush/panther_ws/devel/lib/panther/panther_node ~state:=state ~who_plans:=who_plans 
~term_goal:=term_goal ~trajs_predicted:=tracker_predictor_node/trajs_predicted ~traj:=traj 
~trajs_zhejiang:=trajs_zhejiang ~goal:=goal ~setpoint:=setpoint __name:=panther 
__log:=/home/piyush/.ros/log/9f674d0c-6439-11ec-9abd-d0abd521f44e/SQ01s-panther-13.log].
log file: /home/piyush/.ros/log/9f674d0c-6439-11ec-9abd-d0abd521f44e/SQ01s-panther-13*.log

I am using ROS Melodic on Ubuntu 18.04 and all the packages and dependencies including casadi were installed and built properly. Any help in resolving the above issue would be highly appreciated.
Thanks in advance!

symvar error with Matlab R2023a in MyClampledUniformSpline.m

In Matlab R2023a, I am getting this error:

Error using symvar
...
Invalid argument at position 1. Value must be a character vector or string scalar.

A possible fix is to change this:

if(numel(symvar(ADiffT'))==0)

to this:

if(numel(symvar(sym(ADiffT')))==0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.