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 Gazebo with new masses and sensor suite #193

Merged
merged 45 commits into from
Jun 17, 2017
Merged

Update Gazebo with new masses and sensor suite #193

merged 45 commits into from
Jun 17, 2017

Conversation

chsahit
Copy link
Member

@chsahit chsahit commented Mar 1, 2017

Closes #161
Closes #196

Copy link
Member

@irapha irapha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im approving but there's a to-fix please fix <3

@@ -198,7 +213,7 @@
<headingDriftFrequency>0.0 0.0 0.0</headingDriftFrequency>
<headingGaussianNoise>0.0 0.0 0.0</headingGaussianNoise>
</plugin>
</gazebo>
</gazebo>-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the commented out things?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops just saw this will do

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool. merge when you do, unless you add things then i can rereview

Copy link
Member

@irapha irapha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unapproving since you asked me to. LMK when i can review

chsahit and others added 3 commits March 14, 2017 19:16
…published by gazebo"

This reverts commit 6094942.

Conflicts:
	buzzmobile/simulation/sim_car_interface/src/sim_car_interface.cpp
@irapha irapha changed the title added all the gps stuffs Add GPS to URDF Mar 28, 2017
…zmobile into navsatfix

Conflicts:
	buzzmobile/launch/includes/sim_spawn_car.launch
	buzzmobile/launch/simulation.launch
	buzzmobile/package.xml
…navsatfix

Conflicts:
	buzzmobile/package.xml
@chsahit chsahit changed the title Add GPS to URDF Update Gazebo with new masses and sensor suite Apr 26, 2017
@chsahit
Copy link
Member Author

chsahit commented Apr 26, 2017

@irapha ok updated this PR because I was doing everything on this branch

Copy link
Member

@irapha irapha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also ur build is broken

@@ -44,7 +44,7 @@ wheel_separation: 1.3716 # distance between left and right wheels in meters
max_steering_angle: 0.262 # radians (=15 degrees)

# Max speed of buzzmobile in m/s
max_speed: 0.2
max_speed: 2 #TODO this is a murder machine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change then? just for checking that simulation works?

Copy link
Member Author

@chsahit chsahit May 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our max speed is likely less than 2 m/s but also more than 0.2. I can update the TODO to be more professional (I'll do that for all of them in this PR), but max speed is something we just need to measure. If we left the max speed at 0.2 the car won't move.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we put 0.2 down because the arduino software we got from RJ had a few bugs where in it would flush the speed update messages all at once, causing toyota mode to happen. We fixed it for when it was going forward, but didn't have time to do anything when it was turning.

You can experiment with this speed when you have access to the car, but I'd start with slow speed at first so you don't die while trying to figure out what the ideal speed is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm bumping it down to 1 m/s now as a compromise. Still a bit faster than the car but if we set it to 0.2 then the simulation (running at 0.03 real time factor) doesn't let you see the car move.

@@ -1,5 +1,5 @@
#! /bin/bash

sleep 3
sleep 15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this neeeddeeeeddddddddd??? such overhead, and we're not even using the launch script! why

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a good kludge, there should at least be a todo to investigate what that actually relies on, and to instrument something that manages process deps better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's an issue #158

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it back to 3 since we're not using the launch script.

@@ -9,7 +9,7 @@
<include file="$(find buzzmobile)/launch/includes/mapping.launch"/>
<include file="$(find buzzmobile)/launch/includes/steering.launch"/>
<include file="$(find buzzmobile)/launch/includes/lidar.launch"/>
<include file="$(find buzzmobile)/launch/includes/controller.launch"/>
<!--<include file="$(find buzzmobile)/launch/includes/controller.launch"/>-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh i guess this change makes sense, right? we don't want controller in simulation

wait controller.launch also has car_pose_mux, which we need to make this work. how did you test this at all without car_pose_mux?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you just have rqt publish the state of the car to be 0 (AUTO).

Copy link
Member

@irapha irapha May 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but you still need car_pose_mux. That's the thing that takes in auto_car_pose and outputs car_pose.

I agree you don't need the controller node, but you need the car_pose_mux, which is in controller*.launch*

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm not sure why this worked either because one would think that the PID controller would need to poll the pose of the car to calculate output, but it worked. Nonetheless, I added the car_pose_mux import back.

@@ -41,7 +41,7 @@
BRAKING_DISTANCE = rospy.get_param('braking_distance')
THRESHHOLD = rospy.get_param('braking_score_threshhold')
BUZZMOBILE_WIDTH = rospy.get_param('buzzmobile_width')
MAX_SPEED = rospy.get_param('max_speed', 1.0)
MAX_SPEED = rospy.get_param('max_speed', 2.0) #TODO don't be a murder machine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe fix todo maybe?

@@ -134,6 +134,8 @@ def median_filter(fix):
elif len(g['fixes']) % 2 and len(g['fixes']) > 1:
return sorted_points[index]
elif len(g['fixes']) > 1:
rospy.loginfo("sorted point: ")
rospy.loginfo(sorted_points)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldnt be in PR when its merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, logging might be good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go away qa

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:3

<mass value="5.0"/>
<inertia ixx="0.10595165" ixy="-0.002487144" ixz="0.011981253" iyy="0.126271962" iyz="0.011832006" izz="0.033185337"/>
<mass value="136.0"/>
<inertia ixx="39179.495" ixy="-257.203201" ixz="3771.586" iyy="95397.6332" iyz="-20.60398" izz="94045.9387"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAY CORRECT INERTIALS?

Copy link
Member Author

@chsahit chsahit May 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup! thanks to Matt and Wolfram mathworld!

@@ -342,15 +356,21 @@
<joint name="lidar_joint" type="fixed">
<parent link="chassis"/>
<child link="laser"/>
<origin xyz="0.255 0 0.110" rpy="0 0 0"/>
<origin xyz="0.255 0 5" rpy="0 0 0"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so all you did here was put the lidar way above the car. can you actually place it where our lidar is IRL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, its actually the same height as the base axle and about 12 inches from the front of the chassis.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait so this is.. correct? Or are you gonna update it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no its incorrect, that comment is more a note to myself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Let me know when you have something I can review again.

constexpr double chassis_length = 0.33246;
constexpr double chassis_width = 0.28732;
constexpr double chassis_length = 1.8;
constexpr double chassis_width = 1.57;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these real-world?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but i think they have to be converted to imperial, good catch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh what why omg are you sure?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those look reasonable. 1.8 meters long and 1.57 meters wide.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait hold on this doesn't at all match https://github.com/gtagency/buzzmobile/blob/master/buzzmobile/constants.yaml#L39 (which also says our wheels are 2.2 meters in circumference, which is wrong)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope its all metric, had it flipped in my head. it was autoCAD thats all imperial

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls no hart atak anymor

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshuamorton yeah the dims don't match at all and these were the numbers I got from RJ...
In the CAD those are the dimensions of the car, when (if) I get access to the car, I'll check myself which measurements are correct. For now we should merge it in but with a TODO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made an issue for this #208

constexpr double inv_chassis_length = 1.0 / chassis_length;
constexpr double chassis_width_2 = chassis_width / 2.0;
constexpr double max_torque = 0.1;
constexpr double max_torque = 2.5; //lololol
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol? no. rip

aka pls fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max torque is also just an estimate, but yeah I'll cleanup the comment.

@chsahit
Copy link
Member Author

chsahit commented May 9, 2017

Not sure why builds are failing. According to the circle ci tests
No SHA Files found, caching will not take place
which doesnt mean a lot to me.
According to the simulation tests gazebo is timing out, don't know how to deal with that either.

@jgkamat
Copy link

jgkamat commented May 9, 2017

The SHA files thing is just a missing config file, it dosen't cause a failure, it just means your builds are slower than they could be (in theory) #156

I think this is the error you want to look at:

�[0m[ INFO] [1493243463.256351398]: waitForService: Service [/gazebo/set_physics_properties] is now available.�[0m
�[0m[ INFO] [1493243463.878368355]: Laser Plugin (robotNamespace = /), Info: Using the 'robotNamespace' param: '/'�[0m
�[0m[ INFO] [1493243463.878766596]: Starting Laser Plugin (ns = /)!�[0m
spawn_model script started
[INFO] [WallTime: 1493243455.707552] Loading model xml from file
[INFO] [WallTime: 1493243455.708049] Waiting for service /gazebo/spawn_urdf_model
[INFO] [WallTime: 1493243463.255404] Calling service /gazebo/spawn_urdf_model
[INFO] [WallTime: 1493243463.902857] Spawn status: SpawnModel: Successfully spawned model
�[1m[spawn_model-10] process has finished cleanly
log file: /home/developer/.ros/log/686fa93c-2aca-11e7-98b7-0242ac120002/spawn_model-10*.log�[0m
[spawner-9] killing on exit
[gazebo-8] killing on exit
[buzzmobile/sim_car_interface-7] killing on exit
[buzzmobile/lidar_to_frame-6] killing on exit
[buzzmobile/steering-5] killing on exit
[buzzmobile/frame_merger-4] killing on exit
[buzzmobile/gps_mapper-2] killing on exit
[buzzmobile/bearing-1] killing on exit
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/home/developer/catkin_ws/src/buzzmobile/buzzmobile/sense/maps_querier/maps_querier.py", line 14, in <module>
    import googlemapskey as gmpskey
ImportError: No module named googlemapskey
�[31m[buzzmobile/maps_querier-3] process has died [pid 35068, exit code 1, cmd /home/developer/catkin_ws/src/buzzmobile/buzzmobile/sense/maps_querier/maps_querier.py __name:=maps_querier __log:=/home/developer/.ros/log/686fa93c-2aca-11e7-98b7-0242ac120002/buzzmobile-maps_querier-3.log].
log file: /home/developer/.ros/log/686fa93c-2aca-11e7-98b7-0242ac120002/buzzmobile-maps_querier-3*.log�[0m
libdc1394 error: Failed to initialize libdc1394
libdc1394 error: Failed to initialize libdc1394
libdc1394 error: Failed to initialize libdc1394
libdc1394 error: Failed to initialize libdc1394
Error opening log file: "/home/developer/.gazebo/gzserver.log"
Gazebo multi-robot simulator, version 2.2.3
Copyright (C) 2012-2014 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

�[1;32mMsg�[0m Waiting for master�[1;32mMsg�[0m Connected to gazebo master @ http://127.0.0.1:11345
�[1;32mMsg�[0m Publicized address: 172.18.0.2
�[1;31mError [RenderEngine.cc:665]�[0m Can't open display: 
�[1;33mWarning [RenderEngine.cc:88]�[0m Unable to create X window. Rendering will be disabled
�[1;33mWarning [ModelDatabase.cc:334]�[0m Getting models from[http://gazebosim.org/models/]. This may take a few seconds.
�[1;31mError [CameraSensor.cc:85]�[0m Unable to create CameraSensor. Rendering is disabled.
[WARN] [WallTime: 1493243474.454752] Controller Spawner couldn't find the expected controller_manager ROS interface.
�[31m[gazebo-8] escalating to SIGTERM�[0m
========================== 1 failed in 42.20 seconds ===========================

From the simulation test.

Seems like a missing dependency, so not too big of a deal

@irapha
Copy link
Member

irapha commented May 9, 2017

As a note, @chsahit when you're looking for what caused a circleci build failure, you can either find the failure through the gh badges (see image)

screen shot 2017-05-09 at 10 28 41

or through the runtests.sh in circleci. This second one is a little misleading because the "error" technically occurs in the exit.sh, but trust

screen shot 2017-05-09 at 10 30 17

@jgkamat
Copy link

jgkamat commented May 9, 2017

(also, you can see the pop up thingy for random commits through clicking on the check/x, or for random branches through the branches menu like this):
2017-05-09-103228_747x389_scrot

@irapha
Copy link
Member

irapha commented May 11, 2017 via email

@@ -9,6 +9,7 @@
<include file="$(find buzzmobile)/launch/includes/mapping.launch"/>
<include file="$(find buzzmobile)/launch/includes/steering.launch"/>
<include file="$(find buzzmobile)/launch/includes/lidar.launch"/>
<node pkg="buzzmobile" name="car_pose_mux" type="car_pose_mux.py"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how much I like this solution.. I'd rather have a redundant controller node started (and not doing anything) than launch nodes directly. Others can pitch in but in either case this change doesn't belong in this PR

@@ -44,7 +44,7 @@ wheel_separation: 1.3716 # distance between left and right wheels in meters
max_steering_angle: 0.262 # radians (=15 degrees)

# Max speed of buzzmobile in m/s
max_speed: 2 #TODO this is a murder machine
max_speed: 1 #TODO: measure the max speed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if TODO -> make gh issue
pls

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can sort the issues, i just want us to track TODOs as issues. It's fine for the "TODO" to exist in code too.

@@ -41,7 +41,7 @@
BRAKING_DISTANCE = rospy.get_param('braking_distance')
THRESHHOLD = rospy.get_param('braking_score_threshhold')
BUZZMOBILE_WIDTH = rospy.get_param('buzzmobile_width')
MAX_SPEED = rospy.get_param('max_speed', 2.0) #TODO don't be a murder machine
MAX_SPEED = rospy.get_param('max_speed', 1.0) #TODO measure car max speed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this get_param call have a second argument? Can you just remove it and have it rely on the real param? This way we don't have to modify max_speed in multiple places when we want to modify it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i think the second parameter was there to prevent an exception being thrown if the rosparam server wasn't up or that rosparam wasn't there. But there exists a get_param call that only takes in the first parameter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. And I think that if rosparam server isn't up, this should throw an exception and error out.

@@ -356,7 +356,7 @@
<joint name="lidar_joint" type="fixed">
<parent link="chassis"/>
<child link="laser"/>
<origin xyz="0.255 0 5" rpy="0 0 0"/>
<origin xyz="2 0 0" rpy="0 0 0"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the correct location of the lidar?

if not can you make a TODO and an issue to mesure it in the car exactly?

@@ -39,7 +39,8 @@ constexpr double chassis_length = 1.8;
constexpr double chassis_width = 1.57;
constexpr double inv_chassis_length = 1.0 / chassis_length;
constexpr double chassis_width_2 = chassis_width / 2.0;
constexpr double max_torque = 2.5; //lololol
//TODO(sahit): this can also be calculated/measured when we have the car
constexpr double max_torque = 2.5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make issue too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the measurement ones can be the same issue. Just be sure to link to each line where these TODOs exist

@@ -9,7 +9,8 @@
<include file="$(find buzzmobile)/launch/includes/mapping.launch"/>
<include file="$(find buzzmobile)/launch/includes/steering.launch"/>
<include file="$(find buzzmobile)/launch/includes/lidar.launch"/>
<include file="$(find buzzmobile)/launch/includes/controller.launch"/>
<node pkg="buzzmobile" name="car_pose_mux" type="car_pose_mux.py"/>
<!--<include file="$(find buzzmobile)/launch/includes/controller.launch"/>-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a comment but idk why its not showing up. Id rather have a redundant controller node started than be launching nodes in two different ways in this file.

Others can argue otherwise, but in either case, this change doesnt belong in this PR (unless this is required to make sim work). If you feel strongly abt it then make a new PR pls

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jk it was showing up


constexpr double wheel_circumference = 2.0 * M_PI * 0.036;
constexpr double wheel_circumference = 2.0 * M_PI * 0.3302;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont forget that all of these should eventually be rosparams (and not constants in this file)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue out for this #190 so this PR can be merged

@joshuamorton
Copy link
Member

joshuamorton commented May 11, 2017 via email

@joshuamorton
Copy link
Member

Pls fix.

Traceback (most recent call last):
  File "/home/developer/catkin_ws/src/buzzmobile/buzzmobile/sense/maps_querier/maps_querier.py", line 14, in <module>
    import googlemapskey as gmpskey
ImportError: No module named googlemapskey

Copy link
Member

@joshuamorton joshuamorton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and pull from master to clean up this PR some.

@@ -106,8 +106,13 @@ int main(int argc, char **argv) {
ros::Publisher leftSteeringPublisher = handle.advertise<std_msgs::Float64>("/left_steer_position_controller/command", 1);
ros::Publisher rightSteeringPublisher = handle.advertise<std_msgs::Float64>("/right_steer_position_controller/command", 1);

<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix.

assert(ct.message)

print(ct.message)
time.sleep(30)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try moving this outside of the with block and see what happens/if you can shorten it.

@chsahit
Copy link
Member Author

chsahit commented Jun 11, 2017

@joshuamorton I pulled from master and git reports that my branch is already up to date

@joshuamorton
Copy link
Member

Weird, its giving some really unhelpful diffs that include already merged changes.

@chsahit
Copy link
Member Author

chsahit commented Jun 15, 2017

So I didn't change anything but I went to the circle CI console and hit build and now we're passing... @joshuamorton @irapha

@joshuamorton
Copy link
Member

joshuamorton commented Jun 15, 2017 via email

@irapha
Copy link
Member

irapha commented Jun 17, 2017

holy guacamoli

@irapha
Copy link
Member

irapha commented Jun 17, 2017

Feel free to merge. But before you do, please double check this PR's description to make sure it actually closes the issues listed

@chsahit chsahit merged commit e84f3c8 into master Jun 17, 2017
@joshuamorton joshuamorton deleted the navsatfix branch September 2, 2017 22:25
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.

4 participants