CASPR-RViz is an RViz interface for visualizing cable-driven parallel robots (CDPRs) in CASPR.
- ROS
- Install ROS on your Linux platform (ROS Kinetic Installation)
- Make sure your ROS installation includes rviz (e.g. Desktop-Full Install)
- CASPR
- Install CASPR on MATLAB
- Robotics System Toolbox
- Install Robotics System Toolbox on MATLAB to use ROS on the MATLAB side
- Clone CASPR-RViz to your Linux platform
git clone https://github.com/darwinlau/CASPR-RViz.git
- Build CASPR-RViz
cd CASPR-RViz && catkin_make
- Configure ROS
- Connect the platforms that you installed CASPR-RViz and CASPR
- Note the IP of the platform that you built CASPR-RViz by
ifconfig
- Edit the
~/.bashrc
file bygedit ~/.bashrc
- Put the following lines in your
~/.bashrc
file and save it:
export ROS_IP=[caspr-rviz IP]
export ROS_MASTER_URI=http://$ROS_IP:11311
where [caspr-rviz IP]
refers to the IP of your CASPR-RViz platform
- Add environment variables
source devel/setup.bash
- Launch RViz with:
roslaunch caspr_rviz caspr_rviz.launch
- Enable visualization of meshes and transformations
- Add
Marker
andTF
by pressing theAdd
button of the RVizDisplay
panel
Save Config
for convenience
- Configure CASPR-RViz interface in CASPR
- Note the IP of the platform that you installed CASPR by
ifconfig
(Linux) oripconfig
(Windows) - Call the following function to set the config of CASPR-RViz interface in CASPR:
CASPRRViz_configuration.SetROSConfig('[caspr-rviz IP]','[caspr IP]');
where [caspr-rviz IP]
refers to the IP of your CASPR-RViz platform, and [caspr IP]
refers to the IP of your CASPR platform
- Launch CASPR-RViz
source devel/setup.bash
roslaunch caspr_rviz caspr_rviz.launch
- Launch CASPR GUI on CASPR (MATLAB)
CASPR_GUI
-
Select your desired model in the
Model
drop down menu of CASPR GUI -
Press the
To RViz
button on CASPR GUI -
Select
world
in theGlobal Options > Fixed Frame
drop down menu on the RVizDisplay
panel -
Verify that the robot is successfully visualized in RViz
-
Select your desired model in the
Model
drop down menu of CASPR GUI -
Press the
Kinematics
button inSimulators
-
Press the
Run
button in Kinematics Simulator to run a simulation -
After the simulation is finished, press the
RViz
button to visualize the robot's motion
-
Select your desired model in the
Model
drop down menu of CASPR GUI -
Press the
Dynamics
button inSimulators
-
Press the
Run
button in Dynamics Simulator to run a simulation -
After the simulation is finished, press the
RViz
button to visualize the robot's motion and force vectors
- Change the thickness of the cables by:
rosparam set /cable_scale scale
- Change the color (RGBA) of the cables by:
rosparam set /cable_color [R,G,B,A]
- Change the color (RGBA) of the links by:
rosparam set /link_color [R,G,B,A]
- Change the magnitude of the force arrows by:
rosparam set /force_scale scale
- Change the shape of the force arrows by:
rosparam set /force_arrow_scale [x,y,z]