Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update repo to run with packaged warehouse models and edy arm #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

acmiyaguchi
Copy link

Relies on ivalab/simData#1

This adds some dependencies on simData and ivaEdy so that the launch files work correctly. It removes some of the instructions regarding modifying source files to make things work.

We add a new launch file to test that the warehouse data is working:

roslaunch robotic_gazebo load_hammer.launch

I also manually ran the python scripts, but I don't have access to a kinect or any other hardware, so unfortunately I can't see what side-effects these changes might also have.

@ruinianxu
Copy link
Contributor

@acmiyaguchi I suppose this code is for generating data in gazebo. Why do you need a physical kinect?

@acmiyaguchi
Copy link
Author

This code is actually from last September, before I actually knew how to set up simulated camera nodes. In particular scripts like:

def Load_Camera(world_properties, pose):
### load the kinect
if "kinect_ros" not in world_properties.model_names:
print("Loading the kinect")
with open(HOME + "/models/kinect_ros/model.sdf", "r") as f:
kinect_xml = f.read()
spawn_model("kinect_ros", kinect_xml, "", None, "world")
print("Waiting for Kinect topics to publish")
# just wait for one message to make sure we're good, no timeout hangs forever http://docs.ros.org/diamondback/api/rospy/html/rospy.client-module.html#wait_for_message
rospy.sleep(1.0)
rospy.wait_for_message("/camera/depth/image_raw/compressed", CompressedImage,None)
rospy.wait_for_message("/camera/depth/image_raw", Image, None)

🤔 I can go through and verify that these scripts work, which should probably be done before merging this PR in.

@ruinianxu
Copy link
Contributor

simulated

Sorry I still don't get it. The part of code you cited is about spawning kinect in the gazebo.

@acmiyaguchi
Copy link
Author

Again, that was just reiterating that when I originally opened the PR I didn't know much about gazebo. See this closed trello ticket for some context: https://trello.com/c/fsrCGKDL/17-play-with-models-code-in-simdataimgsaver-and-ivahandy-with-respect-to-a-functional-opencv-bridge

I misunderstood how cameras work in gazebo; I can actually simulate a kinect (or other RGB-D camera). I'm still content to leave this as-is aside from slightly modifications on the simData PR to add in the affordance description files.

Anyways, I tried running the visuomotor_grasp_3D_Box script.

# to start up the gazebo environment
$ roslaunch robotic_gazebo empty_world.launch

# then running the script
$ python src/visuomotor_grasp_3D_Box.py 
Waiting for gazebo servies, be sure to spawn gazebo_ros with rosrun gazebo_ros gazebo or rosrun gazebo_ros gzserver
Gazebo services are up!
MoiveIt! services are up!
World properties: 
sim_time: 40.796
model_names: 
  - ground_plane
rendering_enabled: True
success: True
status_message: "GetWorldProperties: got properties"


Loading the table
Loading the kinect
Waiting for Kinect topics to publish

image

However, when I get to this point, I find that the kinect isn't publishing to the image topics. This is the set of topics:

$ rostopic list
/camera/depth/image_raw/compressed
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/performance_metrics
/gazebo/set_link_state
/gazebo/set_model_state
/rosout
/rosout_agg

If I kill the script and run it again with the gazebo service still up, I see the model spawn but presumably stuck on getting data from the camera:

image

I've reached the threshold of time for this, so I'll come back to it in the future.

@ruinianxu
Copy link
Contributor

I got your point. You thought the issue is due to missing connecting to a physical kinect camera. I will take a look at it and let you know if I have some thoughts.

@ruinianxu
Copy link
Contributor

@acmiyaguchi
I tried to run the script visuomotor_grasp_3D_Box.py but got the following issue:

[ WARN] [1678941774.161695968]: Could not find <sdf> element in sdf, so name and initial position cannot be applied
Error [parser_urdf.cc:3154] Unable to call parseURDF on robot model
Error [parser.cc:488] parse as old deprecated model file failed.

I couldn't have Kinect camera spawned in the Gazebo. After searching over, it seems there is no update for kinect model between previous and noetic version. Not sure where the problem is. I will spend some more time tomorrow.

@acmiyaguchi
Copy link
Author

@ruinianxu Did you add the updated simData repo to your catkin workspace run make build, and also running from my branch of the code? Additionally, what ROS version are you on? I've done all my testing against Noetic.

@ruinianxu
Copy link
Contributor

ruinianxu commented Mar 16, 2023

@ruinianxu Did you add the updated simData repo to your catkin workspace run make build, and also running from my branch of the code? Additionally, what ROS version are you on? I've done all my testing against Noetic.

Yes I did. But the kinect_ros model locates in simData_imgSaver. I cloned your own repo and tested it. I am using Noetic.

@ruinianxu
Copy link
Contributor

@acmiyaguchi
Some updates. I addressed the previous issue about can't parsing sdf file via replacing the model.sdf with the one found online. But I am also stuck at receiving data from the sensor. I suspect the isse comes from the libgazebo_ros_openni_kinect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants