Giter Site home page Giter Site logo

jhu-dvrk / dvrk-ros Goto Github PK

View Code? Open in Web Editor NEW
99.0 26.0 80.0 26.46 MB

daVinci Research Kit ROS stack. See dVRK wiki to get started: https://github.com/jhu-dvrk/sawIntuitiveResearchKit/wiki

Home Page: https://github.com/jhu-dvrk/sawIntuitiveResearchKit/wiki

License: Other

CMake 2.89% Python 63.84% C++ 22.85% MATLAB 9.53% JavaScript 0.29% Objective-C 0.60%
dvrk ros

dvrk-ros's Introduction

da Vinci Research Kit ROS

This repository has code related to daVinci Research Kit (dVRK) ROS packages. See https://github.com/jhu-dvrk/sawIntuitiveResearchKit/wiki

Install

List of Packages:

  • dvrk_robot [maintained]
    • Main file to start dVRK (dvrk_console_json), publish & subscribe ros topics
    • Launch files to start RViz with geometric simulation
  • dvrk_model [mostly maintained]
    • CAD models & meshes
    • RViz configs
    • Launch files
  • dvrk_python [maintained]
    • Python classes using ROS topics
    • Simple API to control any dVRK arm as well as console and teleoperation components
  • dvrk_matlab [maintained, missing some features]
    • Matlab classes using ROS topics
    • Requires Robotics Toolkit (2015a and above), any OS (Windows, Mac, Linux)
    • Simple API to control any dVRK arm
    • No support for console (yet)
  • dvrk_hrsv_widget [maintained]
    • Qt based application that launches two simple widgets to be displayed in stereo console
    • Provides simple text based feedback to operator to understand current state of dVRK components
  • dvrk_arms_from_ros [maintained]
    • cisst/SAW plugin for the dVRK C++ stack to use any arm with a dVRK compatible set of ROS topics
    • This plugin allows to use ROS as middleware between two dVRK sets of arms on different PCs (distant tele-operation)

dvrk-ros's People

Contributors

adeguet1 avatar adnanmunawar avatar arisaracino avatar brcohen59 avatar brendanburkhart avatar caspian0233 avatar gnastacast avatar isanchez12 avatar jbohren avatar jwu96 avatar lz89 avatar neusman1 avatar qian256 avatar simonleonard avatar vincent-hui avatar yijun1hu avatar youritan avatar zchen24 avatar zrwang 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

Watchers

 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

dvrk-ros's Issues

dvrk_ros/dvrk_python README page needs update

Hello, amazing work as always. The example in the README of "dvrk_ros/dvrk_python" folder does not work.

It is currently written as the below:

import dvrk
# Create a Python proxy for PSM1, name must match ros namespace
p = dvrk.psm('PSM1')

It should be updated to something like the following:

import dvrk
import crtk
import time

# Create a Python proxy for PSM1, name must match ros namespace
ral = crtk.ral('testNode')
p = dvrk.psm(ral, 'PSM1')

p.enable()
p.home()
time.sleep(0.2) # need to sleep, otherwise the following code involving motion may not work. In an interactive setting like ipython, this is not needed

Note that I've also added a time.sleep(0.2) otherwise the following code that involves motion may not work. Sleep is not required in an interactive setting like ipython.

size of the vector doesn't match when using set_effort_joint

Hi Anton,
I was commanding the robot by joint effort via python wrapper today. However, I got the following error messages after sending psm1.set_effort_joint(np.array([0.1,0,0,0,0,0],dtype=np.float))

E- cmnThrow with std::exception (vctDynamicVectorLoopEngines: Sizes of vectors don't match)
-W mtsMailbox "Robot[PSM1]": ExecuteNext for command "SetEffortJoint" caught exception "vctDynamicVectorLoopEngines: Sizes of vectors don't match"
-W Class mtsIntuitiveResearchKitPSM: Task PSM1 caught run exception: vctDynamicVectorLoopEngines: Sizes of vectors don't match
E- cmnThrow with std::exception (vctDynamicVectorLoopEngines: Sizes of vectors don't match)
-W mtsMailbox "Robot[PSM1]": ExecuteNext for command "SetEffortJoint" caught exception "vctDynamicVectorLoopEngines: Sizes of vectors don't match"
-W Class mtsIntuitiveResearchKitPSM: Task PSM1 caught run exception: vctDynamicVectorLoopEngines: Sizes of vectors don't match
/home/zrwang/catkin_ws/src/cisst-saw/sawIntuitiveResearchKit/components/code/mtsIntuitiveResearchKitPSM.cpp: Assertion 'jointsKinematics.size() == 6' failed in: virtual void mtsIntuitiveResearchKitPSM::ToJointsPID(const vctDoubleVec&, vctDoubleVec&), line #235
E- File: mtsIntuitiveResearchKitPSM.cpp Line: 235 -  /home/zrwang/catkin_ws/src/cisst-saw/sawIntuitiveResearchKit/components/code/mtsIntuitiveResearchKitPSM.cpp: Assertion 'jointsKinematics.size() == 6' failed in: virtual void mtsIntuitiveResearchKitPSM::ToJointsPID(const vctDoubleVec&, vctDoubleVec&), line #235
Aborted (core dumped)

Could you help me look into this problem? I believe this is a problem of converting the command message into the low level PID control target. We are sending the effort message with length of 6, but we have 7 DoF on the PSM. Thank you so much for your help in advance.

Best regards,
Zerui

arm.jaw.servo_jp and arm.jaw.open() not working as expected

We would like to move the arm and the jaws simultaneously. We first created two separate codes to each move the arm and the jaws. There were no problems when running each code one at a time. The arm was controlled by the arm.servo_jp() and the jaw using the arm.jaw.open() function (so basically move_jp()). However, the jaws started to move very slowly when we ran the codes together.
At every iteration, the jaw moves a fraction of the desired angle (we did not use the .wait() because we would like to move it in parallel). To solve this issue, we tried to run both the arm and jaw servo_jp functions but whenever it executed the jaw's servo_jp, the console shutdowns with PID tracking error for different joints of the arm (we tried different angles and durations).

Camera calibration when using gscam_decklink_stereo

Part 1

To calibrate the cameras in your instructions you start by telling us to run the following command:

roslaunch dvrk_robot gscam_stereo.launch rig_name:=jhu_daVinci rect:=false

However, since I am using the decklink I replaced it by the following command:

roslaunch dvrk_robot gscam_decklink_stereo.launch rig_name:=patterson

Note that in this case I did not pass the arg rect:=false since it doesn't exist in the file gscam_decklink_stereo.launch


Part 2

Then, I tuned the next command from:

rosrun camera_calibration cameracalibrator.py --size 11x10 --square 0.005 right:=/jhu_daVinci/right/image_raw left:=/jhu_daVinci/left/image_raw right_camera:=/jhu_daVinci/right left_camera:=/jhu_daVinci/left --approximate=0.050

to:

rosrun camera_calibration cameracalibrator.py --size 11x10 --square 0.005 right:=/patterson/right/decklink/camera/image_raw left:=/patterson/left/decklink/camera/image_raw right_camera:=/patterson/right/decklink/camera left_camera:=/patterson/left/decklink/camera --approximate=0.050

Basically I replaced jhu_daVinci by patterson, right by right/decklink/camera and left by left/decklink/camera.

However I get the following message:

image

ERR when roslaunch dvrk_model ecm.launch

roslaunch dvrk_model ecm.launch

PARAMETERS

  • /dvrk_ecm/rate: 100
  • /dvrk_ecm/robot_description: <?xml version="1....
  • /dvrk_ecm/source_list: ['joint_states_ro...
  • /dvrk_ecm/use_gui: True
  • /rate: 100
  • /rosdistro: kinetic
  • /rosversion: 1.12.14

NODES
/dvrk_ecm/
joint_state_publisher (joint_state_publisher/joint_state_publisher)
robot_state_publisher (robot_state_publisher/state_publisher)
/
rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [12089]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to ece03df6-5e04-11ea-942c-08719092773c
process[rosout-1]: started with pid [12126]
started core service [/rosout]
process[dvrk_ecm/joint_state_publisher-2]: started with pid [12149]
process[dvrk_ecm/robot_state_publisher-3]: started with pid [12154]
process[rviz-4]: started with pid [12155]
[ERROR] [1583318584.240642619]: No link elements found in urdf file
[dvrk_ecm/robot_state_publisher-3] process has died [pid 12154, exit code 255, cmd /opt/ros/kinetic/lib/robot_state_publisher/state_publisher __name:=robot_state_publisher __log:=/home/ygx/.ros/log/ece03df6-5e04-11ea-942c-08719092773c/dvrk_ecm-robot_state_publisher-3.log].
log file: /home/ygx/.ros/log/ece03df6-5e04-11ea-942c-08719092773c/dvrk_ecm-robot_state_publisher-3*.log
[WARN] [1583318584.481518]: The 'use_gui' parameter was specified, which is deprecated. We'll attempt to find and run the GUI, but if this fails you should install the 'joint_state_publisher_gui' package instead and run that. This backwards compatibility option will be removed in Noetic.
^C[rviz-4] killing on exit
[dvrk_ecm/joint_state_publisher-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit

Problem with simulator

Hi,
i have a problem when i launch the simulator. For example if i launch file ecm.launch i have the following errors "No such file or directory: '/home/andrea/catkin_ws/src/dvrk-ros/dvrk_model/model/ecm.xacro'.
I follow the github tutorial.
Can you help me please?
Tanks

dvrk_calibrate_potentiometers.py TypeError: a bytes-like object is required, not 'str'

There are minor errors when running dvrk_calibrate_potentiometers.py

Environment: python3, Ubuntu20.04, noetic.

File "/home/ben/software/dvrk_ws/src/dvrk-ros/dvrk_robot/scripts/dvrk_calibrate_potentiometers.py", line 339, in <module>
    calibration.run(args.type, args.config)
  File "/home/ben/software/dvrk_ws/src/dvrk-ros/dvrk_robot/scripts/dvrk_calibrate_potentiometers.py", line 250, in run
    writer.writerow(header)
TypeError: a bytes-like object is required, not 'str'

User can easily fixed the issue by replacing

## replacing these lines
# f = open(csv_file_name, 'wb')
f = open(csv_file_name, 'w')

It might be helpful to python3 users. Not sure if it is compatible with python2.

Fail to install dvrk-ros

Hi,

I am trying to install dvrk-ros but the 16 out of 30 files fail to install. I try to run some of the installed packages using rosrun but the terminal shows me error that packages are not found even if the packages are there. I have used source /opt/ros/indigo/setup.bash, and i am in the catkin_ws directory, so I expect the packages to run. How can I install dvrk and start using it?

Thanks

Nick

libDeckLinkAPI.so: cannot open shared object file: No such file or directory [FATAL] [1583319206.210301791]: Failed to PAUSE stream, check your gstreamer configuration

roslaunch dvrk_robot gscam_decklink_stereo.launch rig_name:=jhu_daVinci

SUMMARY

PARAMETERS

  • /jhu_daVinci/left/decklink/jhu_daVinci_left/camera_info_url: package://gscam/e...
  • /jhu_daVinci/left/decklink/jhu_daVinci_left/camera_name: jhu_daVinci_left
  • /jhu_daVinci/left/decklink/jhu_daVinci_left/frame_id: /decklink_frame
  • /jhu_daVinci/left/decklink/jhu_daVinci_left/gscam_config: decklinkvideosrc ...
  • /jhu_daVinci/left/decklink/jhu_daVinci_left/sync_sink: False
  • /jhu_daVinci/right/decklink/jhu_daVinci_right/camera_info_url: package://gscam/e...
  • /jhu_daVinci/right/decklink/jhu_daVinci_right/camera_name: jhu_daVinci_right
  • /jhu_daVinci/right/decklink/jhu_daVinci_right/frame_id: /decklink_frame
  • /jhu_daVinci/right/decklink/jhu_daVinci_right/gscam_config: decklinkvideosrc ...
  • /jhu_daVinci/right/decklink/jhu_daVinci_right/sync_sink: False
  • /rosdistro: kinetic
  • /rosversion: 1.12.14

NODES
/jhu_daVinci/right/
decklink_transform (tf/static_transform_publisher)
/jhu_daVinci/left/decklink/
jhu_daVinci_left (gscam/gscam)
/jhu_daVinci/left/
decklink_transform (tf/static_transform_publisher)
/jhu_daVinci/right/decklink/
jhu_daVinci_right (gscam/gscam)

auto-starting new master
process[master]: started with pid [15885]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 5fa95f24-5e06-11ea-942c-08719092773c
process[rosout-1]: started with pid [15898]
started core service [/rosout]
process[jhu_daVinci/left/decklink/jhu_daVinci_left-2]: started with pid [15915]
process[jhu_daVinci/left/decklink_transform-3]: started with pid [15916]
process[jhu_daVinci/right/decklink/jhu_daVinci_right-4]: started with pid [15919]
process[jhu_daVinci/right/decklink_transform-5]: started with pid [15937]
[ INFO] [1583319206.079828523]: Using gstreamer config from rosparam: "decklinkvideosrc connection=sdi device-number=1 ! videoconvert"
[ INFO] [1583319206.082945732]: camera calibration URL: package://gscam/examples/uncalibrated_parameters.ini
[ WARN] [1583319206.083128904]: [jhu_daVinci_left] does not match name default in file /home/ygx/RBE501_dVRK_Project/catkin_ws_modified/src/gscam/examples/uncalibrated_parameters.ini
[ INFO] [1583319206.083148611]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini
[ INFO] [1583319206.090723689]: Using gstreamer config from rosparam: "decklinkvideosrc connection=sdi device-number=0 ! videoconvert"
[ INFO] [1583319206.093904010]: camera calibration URL: package://gscam/examples/uncalibrated_parameters.ini
[ WARN] [1583319206.094061362]: [jhu_daVinci_right] does not match name default in file /home/ygx/RBE501_dVRK_Project/catkin_ws_modified/src/gscam/examples/uncalibrated_parameters.ini
[ INFO] [1583319206.094079712]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini
[ INFO] [1583319206.210134409]: Time offset: 1583292071.615
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
[FATAL] [1583319206.210301791]: Failed to PAUSE stream, check your gstreamer configuration.
[FATAL] [1583319206.210314451]: Failed to initialize gscam stream!
[ INFO] [1583319206.213197303]: Time offset: 1583292071.615
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
[FATAL] [1583319206.213345622]: Failed to PAUSE stream, check your gstreamer configuration.
[FATAL] [1583319206.213361053]: Failed to initialize gscam stream!
[jhu_daVinci/left/decklink/jhu_daVinci_left-2] process has finished cleanly

Setting up gscam in ROS

I am using a Blackmagic DeckLink Duo 2 video card and I was trying to get the stereo video into ROS. I am also using Ubuntu 16.04 and ROS Kinetic.

I was following the instructions provided here and I am able to get the video when I run the following command:

gst-launch-1.0 decklinkvideosrc device-number=0 ! videoconvert ! autovideosink

So the drivers are working fine.

To get the video into ROS I tried to follow the following instructions:

gscam

gscam is a ROS node using the gstreamer library. The gstreamer
library supports a few frame grabbers including the Hauppage one. The
gstreamer developement library can be installed using apt-get install. Make sure you install gstreamer 1.0, not 0.1.

Important note: gscam binaries provided with ROS kinetic use gstreamer 0.1 so you should not install these using apt. Instead, download the source from github and compile in your catkin workspace. See https://github.com/ros-drivers/gscam. As of March 2018, the readme on gscam/github are a bit confusing since they still indicate that gstreamer 1.x support is experimental but they provide instructions to compile with gstreamer 1.x. So, make sure you compile for 1.x version.

ROS Ubuntu packages

Use apt install to install gscam! The package name should be ros-<distro>-gscam. It will install all the required dependencies for you.

Manual compilation

This is not recommended anymore, there are now ROS packages for gstreamer, just use them!

However, this instructions are a bit confusing. I guess I only need to run the following command:

sudo apt-get install ros-kinetic-gscam

Is this correct?

Possible Issue in Syntax while defining rotation matricies

In the file psm_logic.cpp line 154:
frame6to7 means frame 7 defined in frame 6, right?

Using the same convention:
In the file mtsTeleop.cpp line 60 and 65:

Does mtm2psm mean PSMs frame 0 defined in MTMs frame 0?

And does psm6tomtm7 mean MTMs frame 7 defined in PSMs frame 6?

Assuming so, the formulas in line 83 and 95 do not make sense.

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.